This patch is generated from the nt-2_5 branch of s2_5 in squid Thu Jun 22 00:17:29 2006 GMT See http://devel.squid-cache.org/ Index: squid/Makefile.am diff -u squid/Makefile.am:1.4.22.14 squid/Makefile.am:1.4.22.1.4.13 --- squid/Makefile.am:1.4.22.14 Sat Sep 25 19:14:22 2004 +++ squid/Makefile.am Sun Sep 26 02:49:24 2004 @@ -3,8 +3,8 @@ # $Id$ # -AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5 -DIST_SUBDIRS = lib snmplib scripts src icons errors contrib doc helpers +AUTOMAKE_OPTIONS = dist-bzip2 dist-zip subdir-objects 1.5 +DIST_SUBDIRS = lib snmplib scripts src icons errors contrib doc helpers port SUBDIRS = lib @makesnmplib@ scripts src icons errors doc helpers DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]* Index: squid/acconfig.h diff -u squid/acconfig.h:1.13.2.4 squid/acconfig.h:1.13.6.8 --- squid/acconfig.h:1.13.2.4 Wed Jun 9 07:05:51 2004 +++ squid/acconfig.h Sat Jun 12 02:33:00 2004 @@ -151,6 +151,11 @@ /* Define if NTLM is allowed to fail gracefully when a helper has problems */ #undef NTLM_FAIL_OPEN +/* + * Define Windows NT & Windows 2000 run service mode + */ +#undef USE_WIN32_SERVICE + /******************************** * END OF CONFIGURABLE OPTIONS * ********************************/ @@ -213,6 +218,9 @@ /* Define if you have struct rusage */ #undef HAVE_STRUCT_RUSAGE +/* Define if you have PSAPI.DLL on Windows systems */ +#undef HAVE_WIN32_PSAPI + /* * This makes warnings go away. If you have socklen_t defined in your * /usr/include files, then this should remain undef'd. Otherwise it Index: squid/acinclude.m4 diff -u squid/acinclude.m4:1.2.2.3 squid/acinclude.m4:1.1.64.8 --- squid/acinclude.m4:1.2.2.3 Fri Jun 21 07:50:49 2002 +++ squid/acinclude.m4 Tue Sep 13 06:25:29 2005 @@ -7,7 +7,7 @@ dnl (it at least makes use of , and ) dnl AC_CHECK_SIZEOF_SYSTYPE(TYPE [, CROSS-SIZE]) -AC_DEFUN(AC_CHECK_SIZEOF_SYSTYPE, +AC_DEFUN([AC_CHECK_SIZEOF_SYSTYPE], [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl @@ -46,8 +46,8 @@ ]) dnl AC_CHECK_SYSTYPE(TYPE, DEFAULT) -AC_DEFUN(AC_CHECK_SYSTYPE, -[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_DEFUN([AC_CHECK_SYSTYPE], +[ AC_MSG_CHECKING(for $1) AC_CACHE_VAL(ac_cv_type_$1, [AC_EGREP_CPP(dnl Index: squid/configure.in diff -u squid/configure.in:1.42.2.84 squid/configure.in:1.42.2.5.4.89 --- squid/configure.in:1.42.2.84 Sat May 20 06:41:47 2006 +++ squid/configure.in Sat May 20 23:13:54 2006 @@ -9,7 +9,7 @@ dnl AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(cfgaux) -AM_INIT_AUTOMAKE(squid, 2.5.STABLE14-CVS) +AM_INIT_AUTOMAKE(squid, 2.5.STABLE14-NT-CVS) AM_CONFIG_HEADER(include/autoconf.h) AC_REVISION($Revision$)dnl AC_PREFIX_DEFAULT(/usr/local/squid) @@ -51,7 +51,7 @@ dnl this should be expanded to a list of platform sensible support requirements. dnl (adding an option like --enable-cygwin-support doesn't make sense :]) - R Collins 2001 case "$host_os" in -cygwin|cygwin32) +mingw|mingw32|cygwin|cygwin32) AM_CONDITIONAL(ENABLE_WIN32SPECIFIC, true) ;; *) @@ -59,6 +59,24 @@ ;; esac +case "$host_os" in +mingw|mingw32) + AM_CONDITIONAL(ENABLE_MINGW32SPECIFIC, true) + AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none) + CFLAGS="$CFLAGS -mthreads" + if test "$ac_cv_path_WIN32_PSAPI" = "none"; then + echo "PSAPI.DLL is recommended to run Squid on Windows NT Platform" + echo "Please see PSAPI.DLL section on doc/win32-relnotes.html." + else + AC_DEFINE(HAVE_WIN32_PSAPI) + LIBS="$LIBS -lpsapi" + fi + ;; +*) + AM_CONDITIONAL(ENABLE_MINGW32SPECIFIC, false) + ;; +esac + if test -z "$CACHE_HTTP_PORT"; then CACHE_HTTP_PORT="3128" fi @@ -546,6 +564,12 @@ ;; *-freebsd*) ;; + *-cygwin*) + LIBS="$LIBS -liphlpapi" + ;; + *-mingw*) + LIBS="$LIBS -liphlpapi" + ;; *) echo "WARNING: ARP ACL support probably won't work on $host." sleep 10 @@ -576,7 +600,14 @@ echo "SSL gatewaying using OpenSSL enabled" AC_DEFINE(USE_SSL) AM_CONDITIONAL(ENABLE_SSL, true) - SSLLIB='-lssl -lcrypto' + case "$host_os" in + mingw|mingw32) + SSLLIB='-lssl -lcrypto -lgdi32' + ;; + *) + SSLLIB='-lssl -lcrypto' + ;; + esac USE_OPENSSL=1 fi ]) @@ -932,6 +963,35 @@ fi ]) +dnl Select Default hosts file location +AC_ARG_ENABLE(default-hostsfile, +[ --enable-default-hostsfile=path + Select default location for hosts file. + See hosts_file directive in squid.conf for details], +[ + if test "$enableval" != "none" ; then + if test -f $enableval; then + OPT_DEFAULT_HOSTS=$enableval + else + echo "Warning Unable to find $enableval" + sleep 5 + fi + else + OPT_DEFAULT_HOSTS="none" + fi + echo "Default hosts file set to: $enableval" +],[OPT_DEFAULT_HOSTS="/etc/hosts"]) +AC_SUBST(OPT_DEFAULT_HOSTS) + +dnl Enable WIN32 Service compile mode +AC_ARG_ENABLE(win32-service, +[ --enable-win32-service Compile Squid as a WIN32 Service + Works only on Windows NT and Windows 2000 Platforms.], +[ if test "$enableval" = "yes" ; then + echo "Enabling WIN32 run service mode" + AC_DEFINE(USE_WIN32_SERVICE) + fi +]) dnl Select auth schemes modules to build AC_ARG_ENABLE(auth, @@ -1279,10 +1339,23 @@ esac AC_SUBST(AR_R) +case "$host_os" in +cygwin|cygwin32) + ac_cv_header_stdc='yes' + ;; +esac + dnl Check for headers AC_HEADER_DIRENT AC_HEADER_STDC +case "$host_os" in +mingw|mingw32) + ac_cv_header_crypt_h='yes' + ac_cv_header_getopt_h='yes' + ;; +esac + AC_CHECK_HEADERS( \ arpa/inet.h \ arpa/nameser.h \ @@ -1426,21 +1499,30 @@ AC_DEFINE(HAVE_EXT_MALLINFO) fi -AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [ - AC_TRY_COMPILE([ +case "$host_os" in + mingw|mingw32) + AC_DEFINE(HAVE_STRUCT_RUSAGE) + ac_cv_func_getrusage='yes' + echo "Using own rusage." + ;; + *) + AC_CACHE_CHECK(for struct rusage,ac_cv_have_struct_rusage, [ + AC_TRY_COMPILE([ #if HAVE_SYS_TIME_H #include #endif #if HAVE_SYS_RESOURCE_H #include #endif], - [struct rusage R;], - ac_cv_have_struct_rusage="yes", + [struct rusage R;], + ac_cv_have_struct_rusage="yes", ac_cv_have_struct_rusage="no") ]) -if test $ac_cv_have_struct_rusage = "yes" ; then - AC_DEFINE(HAVE_STRUCT_RUSAGE) -fi + if test $ac_cv_have_struct_rusage = "yes" ; then + AC_DEFINE(HAVE_STRUCT_RUSAGE) + fi + ;; +esac AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [ AC_TRY_COMPILE([#include @@ -1481,6 +1563,17 @@ AC_CHECK_SIZEOF_SYSTYPE(uint64_t) AC_CHECK_SIZEOF_SYSTYPE(u_int64_t) +case "$host_os" in +cygwin|cygwin32) + ac_cv_type_int16_t='yes' + ac_cv_type_int32_t='yes' + ac_cv_type_int64_t='yes' + ac_cv_type_u_int16_t='yes' + ac_cv_type_u_int32_t='yes' + ac_cv_type_u_int64_t='yes' + ;; +esac + dnl int16_t if test "x$ac_cv_sizeof_short" = "x2"; then AC_CHECK_SYSTYPE(int16_t,short) @@ -1572,6 +1665,42 @@ dnl Check for needed libraries AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(socket, main) +AC_MSG_CHECKING(for winsock) +save_LIBS="$LIBS" +for curlib in ws2_32 wsock32; do + LIBS="$LIBS -l$curlib" + AC_TRY_LINK([ + char __attribute__((stdcall)) socket(int,int,int); + char __attribute__((stdcall)) select(int,int,int,int,int); + char __attribute__((stdcall)) closesocket(int); + char __attribute__((stdcall)) gethostname(int,int); + ], + [ + socket(1,2,3); + select(1,2,3,4,5); + closesocket(1); + gethostname(1,2); + ], + have_winsock=yes, have_winsock=no) + + if test $have_winsock = yes; then + ac_cv_func_select='yes' + if test $curlib = ws2_32; then + have_winsock=winsock2 + fi + break + fi + LIBS="$save_LIBS" +done +AC_MSG_RESULT($have_winsock) +case "$host_os" in + mingw|mingw32) + echo "Using own getopt." + AC_LIBOBJ(getopt) + ;; + *) + ;; +esac dnl Ripped from the Samba sources AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [ @@ -1630,7 +1759,14 @@ ;; esac fi -AC_CHECK_LIB(m, main) +case "$host_os" in +mingw|mingw32) + echo "Use MSVCRT for math functions." + ;; + *) + AC_CHECK_LIB(m, main) + ;; +esac dnl Check for libcrypt dnl Some of our helpers use crypt(3) which may be in libc, or in @@ -1798,6 +1934,14 @@ esac fi +dnl Override some functions detect on MinGW becasue are emulated in source code +case "$host_os" in +mingw|mingw32) + ac_cv_func_crypt='yes' + ac_cv_func_statfs='yes' + ;; +esac + dnl Check for library functions AC_CHECK_FUNCS(\ bcopy \ @@ -2164,6 +2308,12 @@ SQUID_MAXFD=`cat conftestval`, SQUID_MAXFD=256, SQUID_MAXFD=256) +dnl Microsoft MSVCRT.DLL supports 2048 maximum FDs +case "$host_os" in +mingw|mingw32) + SQUID_MAXFD="2048" + ;; +esac AC_MSG_RESULT($SQUID_MAXFD) fi # --with-maxfd SQUID_MAXFD AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD) @@ -2327,12 +2477,19 @@ AC_MSG_RESULT("yes") else AC_MSG_RESULT("no") - echo "Will use our own inet_ntoa()." - LIBOBJS="$LIBOBJS inet_ntoa.o" + case "$host_os" in + mingw|mingw32) + echo "Using Win32 resolver instead." + ;; + *) + echo "Will use our own inet_ntoa()." + AC_LIBOBJ(inet_ntoa) # echo "WARNING: This looks bad, and probably prevents Squid from working." # echo " If you're on IRIX and using GCC 2.8, you probably need" # echo " to use the IRIX C compiler instead." # sleep 10 + ;; + esac fi if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then @@ -2482,6 +2639,7 @@ icons/Makefile \ errors/Makefile \ src/fs/aufs/Makefile \ + src/fs/awin32/Makefile \ src/fs/coss/Makefile \ src/fs/diskd/Makefile \ src/fs/null/Makefile \ @@ -2496,6 +2654,7 @@ helpers/basic_auth/NCSA/Makefile \ helpers/basic_auth/PAM/Makefile \ helpers/basic_auth/SMB/Makefile \ + helpers/basic_auth/win32_locallogon/Makefile \ helpers/basic_auth/YP/Makefile \ helpers/basic_auth/getpwnam/Makefile \ helpers/basic_auth/multi-domain-NTLM/Makefile \ @@ -2508,6 +2667,7 @@ helpers/ntlm_auth/no_check/Makefile \ helpers/ntlm_auth/SMB/Makefile \ helpers/ntlm_auth/SMB/smbval/Makefile \ + helpers/ntlm_auth/NTLMSSP-WIN32/Makefile \ helpers/ntlm_auth/winbind/Makefile \ helpers/external_acl/Makefile \ helpers/external_acl/ip_user/Makefile \ @@ -2515,4 +2675,7 @@ helpers/external_acl/unix_group/Makefile \ helpers/external_acl/wbinfo_group/Makefile \ helpers/external_acl/winbind_group/Makefile \ + helpers/external_acl/win32_group/Makefile \ + port/Makefile \ + port/win32/Makefile \ ]) Index: squid/doc/Makefile.am diff -u squid/doc/Makefile.am:1.1.2.7 squid/doc/Makefile.am:1.1.2.1.4.7 --- squid/doc/Makefile.am:1.1.2.7 Sun May 8 19:16:07 2005 +++ squid/doc/Makefile.am Sat May 21 02:45:36 2005 @@ -31,7 +31,8 @@ EXTRA_DIST = \ squid.8.in \ cachemgr.cgi.8.in \ - debug-sections.txt + debug-sections.txt \ + win32-relnotes.html CLEANFILES = \ squid.8 \ Index: squid/doc/win32-relnotes.html diff -u /dev/null squid/doc/win32-relnotes.html:1.1.2.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/doc/win32-relnotes.html Thu Mar 25 11:40:56 2004 @@ -0,0 +1,156 @@ + + + +WIN32 Squid Release Notes + + + + +

WIN32 Squid Release Notes

+
+

Windows Service run mode

+ +

When Squid is compiled as a Windows service, the -N command line switch is disabled, and default run mode of +Squid is no daemon (=no service) mode, so is possible to run Squid from command line +for debug purpose with all command line options available.

+

On Windows 2000/XP/2003 the service is configured to use the Windows Service Recovery option restarting +automatically after 60 seconds.

+ +

Usage

+ +

The squid -? command gives the following output: + +

Usage: squid [-dhirsvzCDFRVYX] [-f config-file] [-[au] port] [-k signal] [-n nam
+e] [-O CommandLine]
+       -a port   Specify HTTP port number (default: 3128).
+       -d level  Write debugging to stderr also.
+       -f file   Use given config-file instead of
+                 c:/squid/etc/squid.conf
+       -h        Print help message.
+       -i        Installs as a Windows Service (see -n option).
+       -k reconfigure|rotate|shutdown|interrupt|kill|debug|check|parse
+                 Parse configuration file, then send signal to
+                 running copy (except -k parse) and exit.
+       -n name   Specify Windows Service name to use for service operations
+                 default is: SquidNT.
+       -r        Removes a Windows Service (see -n option).
+       -s        Enable logging to syslog.
+       -u port   Specify ICP port number (default: 3130), disable with 0.
+       -v        Print version.
+       -z        Create swap directories
+       -C        Do not catch fatal signals.
+       -D        Disable initial DNS tests.
+       -F        Don't serve any requests until store is rebuilt.
+       -O options
+                 Set Windows Service Command line options in Registry.
+       -R        Do not set REUSEADDR on port.
+       -S        Double-check swap during rebuild.
+       -V        Virtual host httpd-accelerator.
+       -X        Force full debugging.
+       -Y        Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload.
+
+ +

The service installation is made with -i command line switch, it's possible to use +-f switch at the same time for specify a different config-file settings for the Squid +Service that is stored on Registry.

+

A new -n switch specify the Windows Service Name, so multiple Squid instance are allowed. +"SquidNT" is the default when the switch is not used.

+ +

So the install service syntax is: +

squid -i [-f file] [-n name]
+

+

To start as service is used a "hidden" --ntservice:service-name command line switch, +where service-name is the name specified with -n options at service install time.

+ +

Service uninstallation is made with -r command line switch plus the appropriate +-n switch.

+ +

The -k switch family must be used with the appropriate -f and -n switches, so the syntax is: + +

squid -k command [-f file] -n service-name
+where service-name is the name specified with -n options at service install time.

+ +

To use Squid original command line, the new -O switch must be used ONCE, the sintax is: + +

squid -O cmdline [-n service-name]
+ +If multiple service command line options must be specified, use quote. The -n switch is +needed only when non default service name is in use.

+Don't use the "Start parameters" in the Windows 2000/XP/2003 Service applet: they are specific to +Windows services functionality and Squid is not designed for understand they

+ +

Example: + +

squid -O "-D -a 8080" -n squidsvc

+ + +

PSAPI.DLL (Process Status Helper) Considerations

+ +

The process status helper functions make it easier for you to obtain information about +processes and device drivers running on Microsoft® Windows NT®/Windows® 2000. These +functions are available in PSAPI.DLL, which is distributed in the Microsoft® Platform +Software Development Kit (SDK). The same information is generally available through the +performance data in the registry, but it is more difficult to get to it. PSAPI.DLL is +freely redistributable.

+ +

PSAPI.DLL is available only on Windows NT, 2000, XP and .NET. The implementation in Squid is +aware of this, and try to use it only on the rigth platform.

+ +

On Windows NT PSAPI.DLL can be found as component of many applications, if you need it, +you can find it on Windows NT Resource KIT. If you have problem, it can be +downloaded from here: +http://download.microsoft.com/download/platformsdk/Redist/4.0.1371.1/NT4/EN-US/psinst.EXE

+ +

On Windows 2000 and later it is available installing the Windows Support Tools, located on the +Support\Tools folder of the installation Windows CD-ROM.

+ + +

Registry DNS lookup

+ +

On Windows platforms, if no value is specified in the dns_nameservers option on +squid.conf or in the /etc/resolv.conf file, the list of DNS name servers are +taken from the Windows registry, both static and dynamic DHCP configurations +are supported.

+ + +

Awin32 fs module

+ +

awin32 is a native WIN32 Async I/O Squid fs module derived from aufs. Configuration +in squid.conf is identical to aufs, but You nedd to specify 'awin32' instead 'aufs' as +cache type.

+ +

Compatibility Notes +

    +
  • It's recommended to use / char in Squid paths instead of \
  • +
  • Paths with spaces (like C:\Programs Files\Squid) are NOT +supported by Squid
  • +
  • When using ACL like acl aclname acltype "file" the file must be in DOS text format (CR+LF) +and the full Windows path must be specified, for example: +
    acl blocklist url_regex -i "c:/squid/etc/blocked1.txt"
    +
  • +
  • The WIN32 equivalent of /dev/null is NUL
  • +
  • Squid doesn't know how to run external helpers based on +scripts, like .bat, .cmd, .vbs, .pl, etc. So in squid.conf the +interpreter path must be always specified, for example: +
    redirect_program c:/perl/bin/perl.exe c:/squid/libexec/redir.pl
    redirect_program c:/winnt/system32/cmd.exe /C c:/squid/libexec/redir.cmd
    +
  • +
  • When Squid runs in command line mode, the launching user account must have administrative privilege on the system
  • +
  • "Start parameters" in the Windows 2000/XP/2003 Service applet cannot be used +
+ +

Known Limitations:

+
    +
  • Squid features not operational:
    +DISKD: needs to be ported - Volunteers are welcome
    +WCCP: cannot work because GRE support on Windows is missing - Volunteers are welcome
    +Transparent Proxy: missing Windows non commercial interception driver
  • +
  • Some code sections can make blocking calls.
  • +
  • Some external helpers may not work.
  • +
  • File Descriptors number hard-limited to 2048
  • +
+
+To report a BUG, e-mail on squidnt@acmeconsulting.it.
+The latest version and documentation can be found on http://www.acmeconsulting.it/SquidNT.htm.
+
+ + Index: squid/helpers/basic_auth/Makefile.am diff -u squid/helpers/basic_auth/Makefile.am:1.1.2.1 squid/helpers/basic_auth/Makefile.am:1.2.8.1 --- squid/helpers/basic_auth/Makefile.am:1.1.2.1 Fri Jun 28 07:46:19 2002 +++ squid/helpers/basic_auth/Makefile.am Sat Jun 29 04:05:59 2002 @@ -3,5 +3,5 @@ # $Id$ # -DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL winbind +DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL winbind win32_locallogon SUBDIRS = @BASIC_AUTH_HELPERS@ Index: squid/helpers/basic_auth/LDAP/Makefile.am diff -u squid/helpers/basic_auth/LDAP/Makefile.am:1.1.2.3 squid/helpers/basic_auth/LDAP/Makefile.am:1.2.8.4 --- squid/helpers/basic_auth/LDAP/Makefile.am:1.1.2.3 Fri Mar 18 17:42:54 2005 +++ squid/helpers/basic_auth/LDAP/Makefile.am Sat Mar 19 00:41:06 2005 @@ -11,5 +11,11 @@ EXTRA_DIST = squid_ldap_auth.8 squid_ldap_auth_SOURCES = squid_ldap_auth.c +if ENABLE_MINGW32SPECIFIC +LDADD = -L$(top_builddir)/lib -lmiscutil -lwldap32 $(XTRA_LIBS) +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_builddir)/include \ + -I$(top_srcdir)/include +else LDADD = -L$(top_builddir)/lib -lmiscutil -lldap $(LIB_LBER) $(XTRA_LIBS) INCLUDES = -I$(top_srcdir)/include +endif Index: squid/helpers/basic_auth/LDAP/squid_ldap_auth.c diff -u squid/helpers/basic_auth/LDAP/squid_ldap_auth.c:1.1.2.24 squid/helpers/basic_auth/LDAP/squid_ldap_auth.c:1.2.8.29 --- squid/helpers/basic_auth/LDAP/squid_ldap_auth.c:1.1.2.24 Sat Feb 25 19:13:56 2006 +++ squid/helpers/basic_auth/LDAP/squid_ldap_auth.c Sun Feb 26 01:14:42 2006 @@ -84,13 +84,44 @@ #define LDAP_DEPRECATED 1 +#include "util.h" + #include #include #include + +#ifdef _SQUID_MSWIN_ /* Native Windows port and MinGW */ + +#define snprintf _snprintf +#include +#include +#ifndef LDAPAPI +#define LDAPAPI __cdecl +#endif +#ifdef LDAP_VERSION3 +#define LDAP_OPT_SUCCESS LDAP_SUCCESS +/* 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 #include -#include "util.h" + +#endif #define PROGRAM_NAME "squid_ldap_auth" @@ -516,6 +547,23 @@ 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, + 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 + while (fgets(buf, 256, stdin) != NULL) { user = strtok(buf, " \r\n"); passwd = strtok(NULL, "\r\n"); Index: squid/helpers/basic_auth/NCSA/Makefile.am diff -u squid/helpers/basic_auth/NCSA/Makefile.am:1.1.2.2 squid/helpers/basic_auth/NCSA/Makefile.am:1.2.8.3 --- squid/helpers/basic_auth/NCSA/Makefile.am:1.1.2.2 Sun Aug 11 18:51:02 2002 +++ squid/helpers/basic_auth/NCSA/Makefile.am Sun Apr 13 08:12:25 2003 @@ -6,7 +6,14 @@ # Uncomment and customize the following to suit your needs: # -libexec_PROGRAMS = ncsa_auth -ncsa_auth_SOURCES = ncsa_auth.c -LDADD = -L$(top_builddir)/lib -lmiscutil $(CRYPTLIB) $(XTRA_LIBS) -INCLUDES = -I$(top_srcdir)/include +libexec_PROGRAMS = ncsa_auth +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_builddir)/include \ + -I$(top_srcdir)/include +ENCRYPTSRC = $(top_srcdir)/port/win32/src/encrypt.c +else +INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include +ENCRYPTSRC = +endif +ncsa_auth_SOURCES = ncsa_auth.c $(ENCRYPTSRC) +LDADD = -L$(top_builddir)/lib -lmiscutil $(CRYPTLIB) $(XTRA_LIBS) Index: squid/helpers/basic_auth/win32_locallogon/.cvsignore diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/.cvsignore Sat Jun 29 04:05:59 2002 @@ -0,0 +1,2 @@ +.cvsignore +Makefile.in Index: squid/helpers/basic_auth/win32_locallogon/Makefile.am diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/Makefile.am:1.1.4.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/Makefile.am Tue Sep 13 09:18:25 2005 @@ -0,0 +1,23 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id$ +# +# Uncomment and customize the following to suit your needs: +# + + +libexec_PROGRAMS = win32_auth + +win32_auth_SOURCES = NT_auth.c valid.c valid.h + +LDADD = -L$(top_builddir)/lib -lnetapi32 -ladvapi32 -lsspwin32 \ + -lmiscutil $(XTRA_LIBS) + +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src +endif + +EXTRA_DIST = README.txt Index: squid/helpers/basic_auth/win32_locallogon/NT_auth.c diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/NT_auth.c:1.1.4.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/NT_auth.c Wed Sep 14 05:12:21 2005 @@ -0,0 +1,188 @@ +/* + NT_auth - Version 2.0 + + Returns OK for a successful authentication, or ERR upon error. + + Guido Serassio, Torino - Italy + + Uses code from - + Antonino Iannella 2000 + Andrew Tridgell 1997 + Richard Sharpe 1996 + Bill Welliver 1999 + + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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 "config.h" +#include +#include +#include "util.h" + +/* Check if we try to compile on a Windows Platform */ +#if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) + +#include "valid.h" + +static char NTGroup[256]; +char * NTAllowedGroup; +char * NTDisAllowedGroup; +int UseDisallowedGroup = 0; +int UseAllowedGroup = 0; +int debug_enabled = 0; + +/* + * options: + * -A can specify a Windows Local Group name allowed to authenticate. + * -D can specify a Windows Local Group name not allowed to authenticate. + * -O can specify the default Domain against to authenticate. + */ +char *my_program_name = NULL; + +void +usage() +{ + fprintf(stderr, + "%s usage:\n%s [-A|D UserGroup][-O DefaultDomain][-d]\n" + "-A can specify a Windows Local Group name allowed to authenticate\n" + "-D can specify a Windows Local Group name not allowed to authenticate\n" + "-O can specify the default Domain against to authenticate\n" + "-d enable debugging.\n" + "-h this message\n\n", + my_program_name, my_program_name); +} + +void +process_options(int argc, char *argv[]) +{ + int opt, had_error = 0; + while (-1 != (opt = getopt(argc, argv, "dhA:D:O:"))) { + switch (opt) { + case 'A': + safe_free(NTAllowedGroup); + NTAllowedGroup=xstrdup(optarg); + UseAllowedGroup = 1; + break; + case 'D': + safe_free(NTDisAllowedGroup); + NTDisAllowedGroup=xstrdup(optarg); + UseDisallowedGroup = 1; + break; + case 'O': + strncpy(Default_NTDomain, optarg, DNLEN); + break; + case 'd': + debug_enabled = 1; + break; + case 'h': + usage(argv[0]); + exit(0); + case '?': + opt = optopt; + /* fall thru to default */ + default: + fprintf(stderr, "Unknown option: -%c. Exiting\n", opt); + had_error = 1; + } + } + if (had_error) { + usage(); + exit(1); + } +} + +/* Main program for simple authentication. + Scans and checks for Squid input, and attempts to validate the user. +*/ + +int +main(int argc, char **argv) + +{ + char wstr[256]; + char username[256]; + char password[256]; + char *p; + int err = 0; + + my_program_name = argv[0]; + process_options(argc, argv); + + debug("%s build " __DATE__ ", " __TIME__ " starting up...\n", my_program_name); + + if (LoadSecurityDll(SSP_BASIC) == NULL) { + fprintf(stderr, "FATAL, can't initialize SSPI, exiting.\n"); + exit(1); + } + debug("SSPI initialized OK\n"); + + atexit(UnloadSecurityDll); + + /* initialize FDescs */ + setbuf(stdout, NULL); + setbuf(stderr, NULL); + + while (1) { + /* Read whole line from standard input. Terminate on break. */ + if (fgets(wstr, 255, stdin) == NULL) + break; + + if (NULL == strchr(wstr, '\n')) { + err = 1; + continue; + } + if (err) { + fprintf(stderr, "Oversized message\n"); + puts("ERR"); + goto error; + } + + if ((p = strchr(wstr, '\n')) != NULL) + *p = '\0'; /* strip \n */ + if ((p = strchr(wstr, '\r')) != NULL) + *p = '\0'; /* strip \r */ + /* Clear any current settings */ + username[0] = '\0'; + password[0] = '\0'; + sscanf(wstr, "%s %s", username, password); /* Extract parameters */ + + debug("Got %s from Squid\n", wstr); + + /* Check for invalid or blank entries */ + if ((username[0] == '\0') || (password[0] == '\0')) { + fprintf(stderr, "Invalid Request\n"); + puts("ERR"); + fflush(stdout); + continue; + } + rfc1738_unescape(username); + rfc1738_unescape(password); + + debug("Trying to validate; %s %s\n", username, password); + + if (Valid_User(username, password, NTGroup) == NTV_NO_ERROR) + puts("OK"); + else + printf("ERR %s\n", errormsg); +error: + err = 0; + fflush(stdout); + } + return 0; +} + +#else /* NON Windows Platform !!! */ + +#error NON WINDOWS PLATFORM + +#endif Index: squid/helpers/basic_auth/win32_locallogon/README.txt diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/README.txt:1.1.4.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/README.txt Tue Sep 13 08:44:27 2005 @@ -0,0 +1,101 @@ +This is a simple authentication module for the Squid proxy server running on Windows NT +to authenticate users on an NT domain in native WIN32 mode. + +Usage is simple. It accepts a username and password on standard input +and will return OK if the username/password is valid for the domain/machine, +or ERR if there was some problem. +It's possible to authenticate against NT trusted domains specifyng the username +in the domain\\username Microsoft notation. + + +============== +Program Syntax +============== + +win32_auth [-A UserGroup][-D UserGroup][-O DefaultDomain][-d] + +-A can specify a Windows Local Group name allowed to authenticate. +-D can specify a Windows Local Group name not allowed to authenticate. +-O can specify the default Domain against to authenticate. +-d enable debugging. + +This is released under the GNU General Public License. + + +============== +Allowing Users +============== + +Users that are allowed to access the web proxy must have the Windows NT +User Rights "logon from the network" and must be included in the NT LOCAL User Groups +specified in the Authenticator's command line. +This can be accomplished creating a local user group on the NT machine, grant the privilege, +and adding users to it. + +Refer to Squid documentation for the required changes to squid.conf. + + +============ +Installation +============ + +Type 'make', then 'make install', then 'make clean'. + +On Cygwin the default is to install 'win32_auth' into /usr/local/squid/libexec, +with other Windows environments into c:/squid/libexec. + +Refer to Squid documentation for the required changes to squid.conf. +You will need to set the following line to enable the authenticator: + +auth_param basic program /usr/local/squid/libexec/win32_auth [options] + +or + +auth_param basic program c:/squid/libexec/win32_auth [options] + +You will need to set the following lines to enable authentication for +your access list - + + acl proxy_auth REQUIRED + http_access allow + +You will need to specify the absolute path to win32_auth in the +'auth_param basic program' directive, and check the 'auth_param basic children' +and 'auth_param basic credentialsttl'. + + +================== +Compilation issues +================== + +The Makefile assumes that GCC is in the current PATH. +win32_auth compile ONLY on Cygwin Environment, MinGW + MSYS Environment +or MS VC++. + + +======= +Testing +======= + +I strongly urge that win32_auth is tested prior to being used in a +production environment. It may behave differently on different platforms. +To test it, run it from the command line. Enter username and password +pairs separated by a space. Press ENTER to get an OK or ERR message. +Make sure pressing behaves the same as a carriage return. +Make sure pressing aborts the program. + +Test that entering no details does not result in an OK or ERR message. +Test that entering an invalid username and password results in an ERR message. +Note that if NT guest user access is allowed on the PDC, an OK message +may be returned instead of ERR. +Test that entering an valid username and password results in an OK message. +Test that entering a guest username and password returns the correct +response for the site's access policy. + + +=============== +Contact details +=============== + +To contact the maintainer of this package, e-mail on squidnt@acmeconsulting.it. + Index: squid/helpers/basic_auth/win32_locallogon/valid.c diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/valid.c:1.1.4.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/valid.c Wed Sep 14 05:12:21 2005 @@ -0,0 +1,181 @@ +/* + NT_auth - Version 2.0 + + Modified to act as a Squid authenticator module. + Removed all Pike stuff. + Returns OK for a successful authentication, or ERR upon error. + + Guido Serassio, Torino - Italy + + Uses code from - + Antonino Iannella 2000 + Andrew Tridgell 1997 + Richard Sharpe 1996 + Bill Welliver 1999 + + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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 "util.h" + +/* Check if we try to compile on a Windows Platform */ +#if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) + +#if defined(_SQUID_CYGWIN_) +#include +#endif +#include "valid.h" + +char Default_NTDomain[DNLEN+1] = NTV_DEFAULT_DOMAIN; +const char * errormsg; + +const char NTV_SERVER_ERROR_MSG[] = "Internal server errror"; +const char NTV_GROUP_ERROR_MSG[] = "User not allowed to use this cache"; +const char NTV_LOGON_ERROR_MSG[] = "No such user or wrong password"; +const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/"; + +/* returns 1 on success, 0 on failure */ +int +Valid_Group(char *UserName, char *Group) +{ + int result = FALSE; + WCHAR wszUserName[256]; // Unicode user name + WCHAR wszGroup[256]; // Unicode Group + + LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pTmpBuf; + DWORD dwLevel = 0; + DWORD dwFlags = LG_INCLUDE_INDIRECT; + DWORD dwPrefMaxLen = -1; + DWORD dwEntriesRead = 0; + DWORD dwTotalEntries = 0; + NET_API_STATUS nStatus; + DWORD i; + DWORD dwTotalCount = 0; + +/* Convert ANSI User Name and Group to Unicode */ + + MultiByteToWideChar(CP_ACP, 0, UserName, + strlen(UserName) + 1, wszUserName, + sizeof(wszUserName) / sizeof(wszUserName[0])); + MultiByteToWideChar(CP_ACP, 0, Group, + strlen(Group) + 1, wszGroup, sizeof(wszGroup) / sizeof(wszGroup[0])); + + /* + * Call the NetUserGetLocalGroups function + * specifying information level 0. + * + * The LG_INCLUDE_INDIRECT flag specifies that the + * function should also return the names of the local + * groups in which the user is indirectly a member. + */ + nStatus = NetUserGetLocalGroups(NULL, + wszUserName, + dwLevel, + dwFlags, + (LPBYTE *) & pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); + /* + * If the call succeeds, + */ + if (nStatus == NERR_Success) { + if ((pTmpBuf = pBuf) != NULL) { + for (i = 0; i < dwEntriesRead; i++) { + if (pTmpBuf == NULL) { + result = FALSE; + break; + } + if (wcscmp(pTmpBuf->lgrui0_name, wszGroup) == 0) { + result = TRUE; + break; + } + pTmpBuf++; + dwTotalCount++; + } + } + } else + result = FALSE; +/* + * Free the allocated memory. + */ + if (pBuf != NULL) + NetApiBufferFree(pBuf); + return result; +} + +/* Valid_User return codes - + 0 - User authenticated successfully. + 1 - Server error. + 2 - Group membership error. + 3 - Logon error; Incorrect password or username given. +*/ + +int +Valid_User(char *UserName, char *Password, char *Group) +{ + int result = NTV_SERVER_ERROR; + size_t i; + char NTDomain[256]; + char *domain_qualify; + char DomainUser[256]; + char User[256]; + + errormsg = NTV_SERVER_ERROR_MSG; + strncpy(NTDomain, UserName, sizeof(NTDomain)); + + for (i=0; i < strlen(NTV_VALID_DOMAIN_SEPARATOR); i++) { + if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[i])) != NULL) + break; + } + if (domain_qualify == NULL) { + strcpy(User, NTDomain); + strcpy(NTDomain, Default_NTDomain); + } else { + strcpy(User, domain_qualify + 1); + domain_qualify[0] = '\0'; + } + /* Log the client on to the local computer. */ + if (!SSP_LogonUser(User, Password, NTDomain)) { + result = NTV_LOGON_ERROR; + errormsg = NTV_LOGON_ERROR_MSG; + debug("%s\n", errormsg); + } else { + result = NTV_NO_ERROR; + if (strcmp(NTDomain, NTV_DEFAULT_DOMAIN) == 0) + strcpy(DomainUser, User); + else { + strcpy(DomainUser, NTDomain); + strcat(DomainUser, "\\"); + strcat(DomainUser, User); + } + if (UseAllowedGroup) { + if (!Valid_Group(DomainUser, NTAllowedGroup)) { + result = NTV_GROUP_ERROR; + errormsg = NTV_GROUP_ERROR_MSG; + debug("%s\n", errormsg); + } + } + if (UseDisallowedGroup) { + if (Valid_Group(DomainUser, NTDisAllowedGroup)) { + result = NTV_GROUP_ERROR; + errormsg = NTV_GROUP_ERROR_MSG; + debug("%s\n", errormsg); + } + } + } + return result; +} +#else /* NON Windows Platform !!! */ + +#error NON WINDOWS PLATFORM + +#endif Index: squid/helpers/basic_auth/win32_locallogon/valid.h diff -u /dev/null squid/helpers/basic_auth/win32_locallogon/valid.h:1.1.4.6 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/basic_auth/win32_locallogon/valid.h Wed Sep 14 05:12:21 2005 @@ -0,0 +1,107 @@ +/* + NT_auth - Version 2.0 + + Modified to act as a Squid authenticator module. + Returns OK for a successful authentication, or ERR upon error. + + Guido Serassio, Torino - Italy + + Uses code from - + Antonino Iannella 2000 + Andrew Tridgell 1997 + Richard Sharpe 1996 + Bill Welliver 1999 + + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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. +*/ + +#ifndef _VALID_H_ +#define _VALID_H_ + +#ifdef _SQUID_CYGWIN_ +#include +#endif +#include +#include "sspwin32.h" +#undef debug + +/************* CONFIGURATION ***************/ +/* + * define this if you want debugging + */ +#ifndef DEBUG +#define DEBUG +#endif + +#define safe_free(x) if (x) { free(x); x = NULL; } + +/* SMB User verification function */ + +#define NTV_NO_ERROR 0 +#define NTV_SERVER_ERROR 1 +#define NTV_GROUP_ERROR 2 +#define NTV_LOGON_ERROR 3 + +#ifndef LOGON32_LOGON_NETWORK +#define LOGON32_LOGON_NETWORK 3 +#endif + +#define NTV_DEFAULT_DOMAIN "." + +extern char * NTAllowedGroup; +extern char * NTDisAllowedGroup; +extern int UseDisallowedGroup; +extern int UseAllowedGroup; +extern int debug_enabled; +extern char Default_NTDomain[DNLEN+1]; +extern const char * errormsg; + +#include + +/* Debugging stuff */ + +#ifdef __GNUC__ /* this is really a gcc-ism */ +#ifdef DEBUG +#include +#include +static char *__foo; +#define debug(X...) if (debug_enabled) { \ + fprintf(stderr,"nt_auth[%d](%s:%d): ", getpid(), \ + ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ + __LINE__);\ + fprintf(stderr,X); } +#else /* DEBUG */ +#define debug(X...) /* */ +#endif /* DEBUG */ +#else /* __GNUC__ */ +static void +debug(char *format,...) +{ +#ifdef DEBUG +#ifdef _SQUID_MSWIN_ + if (debug_enabled) { + va_list args; + + va_start(args,format); + fprintf(stderr, "nt_auth[%d]: ",getpid()); + vfprintf(stderr, format, args); + va_end(args); + } +#endif /* _SQUID_MSWIN_ */ +#endif /* DEBUG */ +} +#endif /* __GNUC__ */ + +int Valid_User(char *,char *, char *); + +#endif Index: squid/helpers/external_acl/Makefile.am diff -u squid/helpers/external_acl/Makefile.am:1.2.2.2 squid/helpers/external_acl/Makefile.am:1.2.8.2 --- squid/helpers/external_acl/Makefile.am:1.2.2.2 Wed Jul 17 08:30:22 2002 +++ squid/helpers/external_acl/Makefile.am Fri Jul 12 23:29:15 2002 @@ -3,5 +3,5 @@ # $Id$ # -DIST_SUBDIRS = ip_user ldap_group unix_group wbinfo_group winbind_group +DIST_SUBDIRS = ip_user ldap_group unix_group wbinfo_group winbind_group win32_group SUBDIRS = @EXTERNAL_ACL_HELPERS@ Index: squid/helpers/external_acl/ip_user/Makefile.am diff -u squid/helpers/external_acl/ip_user/Makefile.am:1.1.6.3 squid/helpers/external_acl/ip_user/Makefile.am:1.1.12.3 --- squid/helpers/external_acl/ip_user/Makefile.am:1.1.6.3 Sun Jul 21 19:09:41 2002 +++ squid/helpers/external_acl/ip_user/Makefile.am Sun Dec 1 01:28:10 2002 @@ -24,7 +24,15 @@ # sysconf_DATA = +if ENABLE_MINGW32SPECIFIC +LDADD = -L$(top_builddir)/lib -lmiscutil \ + @XTRA_LIBS@ + +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I$(top_srcdir)/src/ +else LDADD = @XTRA_LIBS@ INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_srcdir)/src/ +endif Index: squid/helpers/external_acl/ip_user/dict.c diff -u squid/helpers/external_acl/ip_user/dict.c:1.1.12.2 squid/helpers/external_acl/ip_user/dict.c:1.1.16.2 --- squid/helpers/external_acl/ip_user/dict.c:1.1.12.2 Wed Jul 17 08:30:22 2002 +++ squid/helpers/external_acl/ip_user/dict.c Sun Dec 1 01:28:10 2002 @@ -23,9 +23,13 @@ #include #include #include +#ifdef _WIN32 +#include +#else #include #include #include +#endif #include "ip_user.h" @@ -129,9 +133,11 @@ if ((strchr (current_entry->username, '@')) == NULL) { if ((match_user (current_entry->username, username)) == 1) return 1; +#ifndef _WIN32 } else { if ((match_group (current_entry->username, username)) == 1) return 1; +#endif } } current_entry = current_entry->next_entry; Index: squid/helpers/external_acl/ip_user/main.c diff -u squid/helpers/external_acl/ip_user/main.c:1.2.2.2 squid/helpers/external_acl/ip_user/main.c:1.2.6.2 --- squid/helpers/external_acl/ip_user/main.c:1.2.2.2 Wed Jul 17 08:30:22 2002 +++ squid/helpers/external_acl/ip_user/main.c Sun Dec 1 01:28:10 2002 @@ -20,7 +20,11 @@ */ #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include Index: squid/helpers/external_acl/ip_user/match.c diff -u squid/helpers/external_acl/ip_user/match.c:1.1.12.2 squid/helpers/external_acl/ip_user/match.c:1.1.16.2 --- squid/helpers/external_acl/ip_user/match.c:1.1.12.2 Wed Jul 17 08:30:22 2002 +++ squid/helpers/external_acl/ip_user/match.c Sun Dec 1 01:28:10 2002 @@ -21,7 +21,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif int @@ -37,6 +39,7 @@ return 0; } /* match_user */ +#ifndef _WIN32 int match_group (char *dict_group, char *username) { @@ -59,3 +62,4 @@ return 0; } /* match_group */ +#endif Index: squid/helpers/external_acl/ldap_group/Makefile.am diff -u squid/helpers/external_acl/ldap_group/Makefile.am:1.1.6.5 squid/helpers/external_acl/ldap_group/Makefile.am:1.1.12.5 --- squid/helpers/external_acl/ldap_group/Makefile.am:1.1.6.5 Fri Mar 18 17:42:54 2005 +++ squid/helpers/external_acl/ldap_group/Makefile.am Sat Mar 19 00:41:06 2005 @@ -11,4 +11,11 @@ EXTRA_DIST = squid_ldap_group.8 squid_ldap_group_SOURCES = squid_ldap_group.c +if ENABLE_MINGW32SPECIFIC +LDADD = -L$(top_builddir)/lib -lwldap32 $(XTRA_LIBS) +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_builddir)/include \ + -I$(top_srcdir)/include +else LDADD = -lldap $(LIB_LBER) $(XTRA_LIBS) +INCLUDES = -I$(top_srcdir)/include +endif Index: squid/helpers/external_acl/ldap_group/squid_ldap_group.c diff -u squid/helpers/external_acl/ldap_group/squid_ldap_group.c:1.1.2.19 squid/helpers/external_acl/ldap_group/squid_ldap_group.c:1.1.6.23 --- squid/helpers/external_acl/ldap_group/squid_ldap_group.c:1.1.2.19 Sat Feb 25 19:13:56 2006 +++ squid/helpers/external_acl/ldap_group/squid_ldap_group.c Sun Feb 26 01:14:42 2006 @@ -39,8 +39,39 @@ #include #include #include + +#ifdef _WIN32 /* Native Windows port and MinGW */ + +#define snprintf _snprintf +#include +#include +#ifndef LDAPAPI +#define LDAPAPI __cdecl +#endif +#ifdef LDAP_VERSION3 +#define LDAP_OPT_SUCCESS LDAP_SUCCESS +/* 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 + #if defined(LDAP_OPT_NETWORK_TIMEOUT) #include #endif @@ -437,6 +468,23 @@ 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, + so we need to bind at run-time with the function entry point + */ +#ifdef _WIN32 + 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 + while (fgets(buf, 256, stdin) != NULL) { char *tptr; int found = 0; Index: squid/helpers/external_acl/win32_group/.cvsignore diff -u /dev/null squid/helpers/external_acl/win32_group/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/external_acl/win32_group/.cvsignore Sat Jun 29 06:21:45 2002 @@ -0,0 +1,2 @@ +.cvsignore +Makefile.in Index: squid/helpers/external_acl/win32_group/Makefile.am diff -u /dev/null squid/helpers/external_acl/win32_group/Makefile.am:1.1.8.8 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/external_acl/win32_group/Makefile.am Thu Sep 15 02:55:04 2005 @@ -0,0 +1,23 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id$ +# +# Uncomment and customize the following to suit your needs: +# + + +libexec_PROGRAMS = win32_check_group + +win32_check_group_SOURCES = win32_check_group.c win32_check_group.h + +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src +endif + +LDADD = -L$(top_builddir)/lib -lmiscutil -lnetapi32 -ladvapi32 \ + -lntdll $(XTRA_LIBS) + +EXTRA_DIST = readme.txt Index: squid/helpers/external_acl/win32_group/readme.txt diff -u /dev/null squid/helpers/external_acl/win32_group/readme.txt:1.1.8.12 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/external_acl/win32_group/readme.txt Thu Sep 15 02:55:04 2005 @@ -0,0 +1,86 @@ + +This is the readme.txt file for win32_check_group, an external +helper fo the External ACL Scheme for Squid. + + +This helper must be used in with an authentication scheme, tipically +basic or NTLM, based on Windows NT/2000 domain users. +It reads from the standard input the domain username and a list of groups +and tries to match it against the groups membership of the specified +username. + + +============== +Program Syntax +============== + +win32_check_group [-D domain][-G][-P][-c][-d][-h] + +-D domain specify the default user's domain +-G start helper in Domain Global Group mode +-P use ONLY PDCs for group validation +-c use case insensitive compare +-d enable debugging +-h this message + + +================ +squid.conf usage +================ + +external_acl_type NT_global_group %LOGIN c:/squid/libexec/win32_check_group.exe -G +external_acl_type NT_local_group %LOGIN c:/squid/libexec/win32_check_group.exe + +acl GProxyUsers external NT_global_group GProxyUsers +acl LProxyUsers external NT_local_group LProxyUsers +acl password proxy_auth REQUIRED + +http_access allow password GProxyUsers +http_access allow password LProxyUsers +http_access deny all + +In the previous example all validated NT users member of GProxyUsers Global +domain group or member of LProxyUsers machine local group are allowed to +use the cache. + +Groups with spaces in name, for example "Domain Users", must be quoted and +the acl data ("Domain Users") must be placed into a separate file included +by specifying "/path/to/file". The previous example will be: + +acl ProxyUsers external NT_global_group "c:/squid/etc/DomainUsers" + +and the DomainUsers files will contain only the following line: + +"Domain Users" + +NOTES: +- The standard group name comparation is case sensitive, so group name + must be specified with same case as in the NT/2000 Domain. + It's possible to enable not case sensitive group name comparation (-c), + but on on some non - English locales, the results can be unexpected. +- Native WIN32 NTLM and Basic Helpers must be used without the + -A & -D switches. + +Refer to Squid documentation for the more details on squid.conf. + + +======= +Testing +======= + +I strongly urge that win32_check_group is tested prior to being used in a +production environment. It may behave differently on different platforms. +To test it, run it from the command line. Enter username and group +pairs separated by a space (username must entered with domain\\username +syntax). Press ENTER to get an OK or ERR message. +Make sure pressing behaves the same as a carriage return. +Make sure pressing aborts the program. + +Test that entering no details does not result in an OK or ERR message. +Test that entering an invalid username and group results in an ERR message. +Test that entering an valid username and group results in an OK message. + +-- +Serassio Guido +squidnt at acmeconsulting dot it + Index: squid/helpers/external_acl/win32_group/win32_check_group.c diff -u /dev/null squid/helpers/external_acl/win32_group/win32_check_group.c:1.1.8.21 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/external_acl/win32_group/win32_check_group.c Thu Sep 15 02:55:04 2005 @@ -0,0 +1,644 @@ +/* + * win32_group: lookup group membership in a Windows NT/2000 domain + * + * (C)2002,2005 Guido Serassio - Acme Consulting S.r.l. + * + * Authors: + * Guido Serassio + * Acme Consulting S.r.l., Italy + * + * With contributions from others mentioned in the change history section + * below. + * + * In part based on check_group by Rodrigo Albani de Campos. + * + * Dependencies: Windows NT4 SP4 and later. + * + * 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. + * + * History: + * + * Version 1.22 + * 08-07-2005 Guido Serassio + * Added -P option for force usage of PDCs for group validation. + * Added support for '/' char as domain separator. + * Fixed Bugzilla #1336. + * Version 1.21 + * 23-04-2005 Guido Serassio + * Added -D option for specify default user's domain. + * Version 1.20 + * 13-06-2004 Guido Serassio + * Added support for running on a Domain Controller. + * Version 1.10 + * 01-05-2003 Guido Serassio + * Added option for case insensitive group name comparation. + * More debug info. + * Updated documentation. + * Segfault bug fix (Bugzilla #574) + * Version 1.0 + * 24-06-2002 Guido Serassio + * Using the main function from check_group and sections + * from wbinfo wrote win32_group + * + * This is a helper for the external ACL interface for Squid Cache + * + * It reads from the standard input the domain username and a list of + * groups and tries to match it against the groups membership of the + * specified username. + * + * Returns `OK' if the user belongs to a group or `ERR' otherwise, as + * described on http://devel.squid-cache.org/external_acl/config.html + * + */ + +#include "config.h" +#ifdef _SQUID_CYGWIN_ +#include +int _wcsicmp(const wchar_t*, const wchar_t*); +#endif +#if HAVE_STDIO_H +#include +#endif +#if HAVE_CTYPE_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#if HAVE_GETOPT_H +#include +#endif +#undef assert +#include +#include +#include +#include + +#include "util.h" + +#define BUFSIZE 8192 /* the stdin buffer size */ +int use_global = 0; +int use_PDC_only = 0; +char debug_enabled = 0; +char *myname; +pid_t mypid; +char * machinedomain; +int use_case_insensitive_compare = 0; +char * DefaultDomain = NULL; +const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/"; + +#include "win32_check_group.h" + +char * +strwordtok(char *buf, char **t) +{ + unsigned char *word = NULL; + unsigned char *p = (unsigned char *) buf; + unsigned char *d; + unsigned char ch; + int quoted = 0; + if (!p) + p = (unsigned char *) *t; + if (!p) + goto error; + while (*p && isspace(*p)) + p++; + if (!*p) + goto error; + word = d = p; + while ((ch = *p)) { + switch (ch) { + case '\\': + p++; + *d++ = ch = *p; + if (ch) + p++; + break; + case '"': + quoted = !quoted; + p++; + break; + default: + if (!quoted && isspace(*p)) { + p++; + goto done; + } + *d++ = *p++; + break; + } + } + done: + *d++ = '\0'; + error: + *t = (char *) p; + return (char *) word; +} + + +char * AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr) +{ + size_t len; + static char * target; + + len = LsaStr.Length/sizeof(WCHAR) + 1; + + /* allocate buffer for str + null termination */ + safe_free(target); + target = (char *)xmalloc(len); + if (target == NULL) + return NULL; + + /* copy unicode buffer */ + WideCharToMultiByte(CP_ACP, 0, LsaStr.Buffer, LsaStr.Length, target, len, NULL, NULL ); + + /* add null termination */ + target[len-1] = '\0'; + return target; +} + + +char * GetDomainName(void) + +{ + LSA_HANDLE PolicyHandle; + LSA_OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS status; + PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo; + PWKSTA_INFO_100 pwkiWorkstationInfo; + DWORD netret; + char * DomainName = NULL; + + /* + * Always initialize the object attributes to all zeroes. + */ + memset(&ObjectAttributes, '\0', sizeof(ObjectAttributes)); + + /* + * You need the local workstation name. Use NetWkstaGetInfo at level + * 100 to retrieve a WKSTA_INFO_100 structure. + * + * The wki100_computername field contains a pointer to a UNICODE + * string containing the local computer name. + */ + netret = NetWkstaGetInfo(NULL, 100, (LPBYTE *)&pwkiWorkstationInfo); + if (netret == NERR_Success) { + /* + * We have the workstation name in: + * pwkiWorkstationInfo->wki100_computername + * + * Next, open the policy object for the local system using + * the LsaOpenPolicy function. + */ + status = LsaOpenPolicy( + NULL, + &ObjectAttributes, + GENERIC_READ | POLICY_VIEW_LOCAL_INFORMATION, + &PolicyHandle + ); + + /* + * Error checking. + */ + if (status) { + debug("OpenPolicy Error: %ld\n", status); + } else { + + /* + * You have a handle to the policy object. Now, get the + * domain information using LsaQueryInformationPolicy. + */ + status = LsaQueryInformationPolicy(PolicyHandle, + PolicyPrimaryDomainInformation, + (PVOID *)&ppdiDomainInfo); + if (status) { + debug("LsaQueryInformationPolicy Error: %ld\n", status); + } else { + + /* Get name in useable format */ + DomainName = AllocStrFromLSAStr(ppdiDomainInfo->Name); + + /* + * Check the Sid pointer, if it is null, the + * workstation is either a stand-alone computer + * or a member of a workgroup. + */ + if (ppdiDomainInfo->Sid) { + + /* + * Member of a domain. Display it in debug mode. + */ + debug("Member of Domain %s\n",DomainName); + } else { + DomainName = NULL; + } + } + } + + /* + * Clean up all the memory buffers created by the LSA and + * Net* APIs. + */ + NetApiBufferFree(pwkiWorkstationInfo); + LsaFreeMemory((LPVOID)ppdiDomainInfo); + } else + debug("NetWkstaGetInfo Error: %ld\n", netret); + return DomainName; +} + +/* returns 0 on match, -1 if no match */ +static int wcstrcmparray(const wchar_t *str, const char **array) +{ + WCHAR wszGroup[GNLEN+1]; // Unicode Group + + while (*array) { + MultiByteToWideChar(CP_ACP, 0, *array, + strlen(*array) + 1, wszGroup, sizeof(wszGroup) / sizeof(wszGroup[0])); + debug("Windows group: %S, Squid group: %S\n", str, wszGroup); + if ((use_case_insensitive_compare ? _wcsicmp(str, wszGroup) : wcscmp(str, wszGroup)) == 0) + return 0; + array++; + } + return -1; +} + +/* returns 1 on success, 0 on failure */ +int +Valid_Local_Groups(char *UserName, const char **Groups) +{ + int result = 0; + char * Domain_Separator; + WCHAR wszUserName[UNLEN+1]; // Unicode user name + + LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pTmpBuf; + DWORD dwLevel = 0; + DWORD dwFlags = LG_INCLUDE_INDIRECT; + DWORD dwPrefMaxLen = -1; + DWORD dwEntriesRead = 0; + DWORD dwTotalEntries = 0; + NET_API_STATUS nStatus; + DWORD i; + DWORD dwTotalCount = 0; + + if ((Domain_Separator = strchr(UserName, '/')) != NULL) + *Domain_Separator = '\\'; + + debug("Valid_Local_Groups: checking group membership of '%s'.\n", UserName); + +/* Convert ANSI User Name and Group to Unicode */ + + MultiByteToWideChar(CP_ACP, 0, UserName, + strlen(UserName) + 1, wszUserName, sizeof(wszUserName) / sizeof(wszUserName[0])); + + /* + * Call the NetUserGetLocalGroups function + * specifying information level 0. + * + * The LG_INCLUDE_INDIRECT flag specifies that the + * function should also return the names of the local + * groups in which the user is indirectly a member. + */ + nStatus = NetUserGetLocalGroups( + NULL, + wszUserName, + dwLevel, + dwFlags, + (LPBYTE *) &pBuf, + dwPrefMaxLen, + &dwEntriesRead, + &dwTotalEntries); + /* + * If the call succeeds, + */ + if (nStatus == NERR_Success) { + if ((pTmpBuf = pBuf) != NULL) { + for (i = 0; i < dwEntriesRead; i++) { + assert(pTmpBuf != NULL); + if (pTmpBuf == NULL) { + result = 0; + break; + } + if (wcstrcmparray(pTmpBuf->lgrui0_name, Groups) == 0) { + result = 1; + break; + } + pTmpBuf++; + dwTotalCount++; + } + } + } else + result = 0; +/* + * Free the allocated memory. + */ + if (pBuf != NULL) + NetApiBufferFree(pBuf); + return result; +} + + +/* returns 1 on success, 0 on failure */ +int +Valid_Global_Groups(char *UserName, const char **Groups) +{ + int result = 0; + WCHAR wszUserName[UNLEN+1]; // Unicode user name + WCHAR wszLocalDomain[DNLEN+1]; // Unicode Local Domain + WCHAR wszUserDomain[DNLEN+1]; // Unicode User Domain + + char NTDomain[DNLEN+UNLEN+2]; + char *domain_qualify; + char User[UNLEN+1]; + size_t j; + + LPWSTR LclDCptr = NULL; + LPWSTR UsrDCptr = NULL; + LPGROUP_USERS_INFO_0 pUsrBuf = NULL; + LPGROUP_USERS_INFO_0 pTmpBuf; + LPSERVER_INFO_101 pSrvBuf = NULL; + DWORD dwLevel = 0; + DWORD dwPrefMaxLen = -1; + DWORD dwEntriesRead = 0; + DWORD dwTotalEntries = 0; + NET_API_STATUS nStatus; + DWORD i; + DWORD dwTotalCount = 0; + + strncpy(NTDomain, UserName, sizeof(NTDomain)); + + for (j=0; j < strlen(NTV_VALID_DOMAIN_SEPARATOR); j++) { + if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[j])) != NULL) + break; + } + if (domain_qualify == NULL) { + strcpy(User, NTDomain); + strcpy(NTDomain, DefaultDomain); + } else { + strcpy(User, domain_qualify + 1); + domain_qualify[0] = '\0'; + strlwr(NTDomain); + } + + debug("Valid_Global_Groups: checking group membership of '%s\\%s'.\n", NTDomain, User); + + /* Convert ANSI User Name and Group to Unicode */ + + MultiByteToWideChar(CP_ACP, 0, User, + strlen(User) + 1, wszUserName, + sizeof(wszUserName) / sizeof(wszUserName[0])); + MultiByteToWideChar(CP_ACP, 0, machinedomain, + strlen(machinedomain) + 1, wszLocalDomain, sizeof(wszLocalDomain) / sizeof(wszLocalDomain[0])); + + +/* Call the NetServerGetInfo function for local computer, specifying level 101. */ + dwLevel = 101; + nStatus = NetServerGetInfo(NULL, dwLevel, (LPBYTE *)&pSrvBuf); + + if (nStatus == NERR_Success) + { + /* Check if we are running on a Domain Controller */ + if ((pSrvBuf->sv101_type & SV_TYPE_DOMAIN_CTRL) || + (pSrvBuf->sv101_type & SV_TYPE_DOMAIN_BAKCTRL)) + { + LclDCptr = NULL; + debug("Running on a DC.\n"); + } + else + nStatus = (use_PDC_only ? NetGetDCName(NULL, wszLocalDomain, (LPBYTE *) & LclDCptr) : NetGetAnyDCName(NULL, wszLocalDomain, (LPBYTE *) & LclDCptr)); + } else { + fprintf(stderr, "%s NetServerGetInfo() failed.'\n", myname); + if (pSrvBuf != NULL) + NetApiBufferFree(pSrvBuf); + return result; + } + + if (nStatus == NERR_Success) { + debug("Using '%S' as DC for '%S' local domain.\n", LclDCptr, wszLocalDomain); + + if (strcmp(NTDomain, machinedomain) != 0) { + MultiByteToWideChar(CP_ACP, 0, NTDomain, + strlen(NTDomain) + 1, wszUserDomain, sizeof(wszUserDomain) / sizeof(wszUserDomain[0])); + nStatus = (use_PDC_only ? NetGetDCName(LclDCptr, wszUserDomain, (LPBYTE *) & UsrDCptr) : NetGetAnyDCName(LclDCptr, wszUserDomain, (LPBYTE *) & UsrDCptr)); + if (nStatus != NERR_Success) { + fprintf(stderr, "%s Can't find DC for user's domain '%s'\n", myname, NTDomain); + if (pSrvBuf != NULL) + NetApiBufferFree(pSrvBuf); + if (LclDCptr != NULL) + NetApiBufferFree((LPVOID) LclDCptr); + if (UsrDCptr != NULL) + NetApiBufferFree((LPVOID) UsrDCptr); + return result; + } + } else + UsrDCptr = LclDCptr; + + debug("Using '%S' as DC for '%s' user's domain.\n", UsrDCptr, NTDomain); + /* + * Call the NetUserGetGroups function + * specifying information level 0. + */ + dwLevel = 0; + nStatus = NetUserGetGroups(UsrDCptr, + wszUserName, + dwLevel, + (LPBYTE *) & pUsrBuf, + dwPrefMaxLen, + &dwEntriesRead, + &dwTotalEntries); + /* + * If the call succeeds, + */ + if (nStatus == NERR_Success) { + if ((pTmpBuf = pUsrBuf) != NULL) { + for (i = 0; i < dwEntriesRead; i++) { + assert(pTmpBuf != NULL); + if (pTmpBuf == NULL) { + result = 0; + break; + } + if (wcstrcmparray(pTmpBuf->grui0_name, Groups) == 0) { + result = 1; + break; + } + pTmpBuf++; + dwTotalCount++; + } + } + } else { + result = 0; + fprintf(stderr, "%s NetUserGetGroups() failed.'\n", myname); + } + } else { + fprintf(stderr, "%s Can't find DC for local domain '%s'\n", myname, machinedomain); + } + /* + * Free the allocated memory. + */ + if (pSrvBuf != NULL) + NetApiBufferFree(pSrvBuf); + if (pUsrBuf != NULL) + NetApiBufferFree(pUsrBuf); + if ((UsrDCptr != NULL) && (UsrDCptr != LclDCptr)) + NetApiBufferFree((LPVOID) UsrDCptr); + if (LclDCptr != NULL) + NetApiBufferFree((LPVOID) LclDCptr); + return result; +} + +static void +usage(char *program) +{ + fprintf(stderr,"Usage: %s [-D domain][-G][-P][-c][-d][-h]\n" + " -D default user Domain\n" + " -G enable Domain Global group mode\n" + " -P use ONLY PDCs for group validation\n" + " -c use case insensitive compare\n" + " -d enable debugging\n" + " -h this message\n", + program); +} + +void +process_options(int argc, char *argv[]) +{ + int opt; + + opterr = 0; + while (-1 != (opt = getopt(argc, argv, "D:GPcdh"))) { + switch (opt) { + case 'D': + DefaultDomain = xstrndup(optarg, DNLEN + 1); + strlwr(DefaultDomain); + break; + case 'G': + use_global = 1; + break; + case 'P': + use_PDC_only = 1; + break; + case 'c': + use_case_insensitive_compare = 1; + break; + case 'd': + debug_enabled = 1; + break; + case 'h': + usage(argv[0]); + exit(0); + case '?': + opt = optopt; + /* fall thru to default */ + default: + fprintf(stderr, "%s Unknown option: -%c. Exiting\n", myname, opt); + usage(argv[0]); + exit(1); + break; /* not reached */ + } + } + return; +} + + +int +main (int argc, char *argv[]) +{ + char *p, *t; + char buf[BUFSIZE]; + char *username; + char *group; + int err = 0; + const char *groups[512]; + int n; + + if (argc > 0) { /* should always be true */ + myname=strrchr(argv[0],'/'); + if (myname==NULL) + myname=argv[0]; + } else { + myname="(unknown)"; + } + mypid=getpid(); + + setbuf(stdout, NULL); + setbuf(stderr, NULL); + + /* Check Command Line */ + process_options(argc, argv); + + if (use_global) { + if ((machinedomain = GetDomainName()) == NULL) { + fprintf(stderr, "%s Can't read machine domain\n", myname); + exit(1); + } + strlwr(machinedomain); + if (!DefaultDomain) + DefaultDomain = xstrdup(machinedomain); + } + + debug("External ACL win32 group helper build " __DATE__ ", " __TIME__ + " starting up...\n"); + if (use_global) + debug("Domain Global group mode enabled using '%s' as default domain.\n", DefaultDomain); + if (use_case_insensitive_compare) + debug("Warning: running in case insensitive mode !!!\n"); + if (use_PDC_only) + debug("Warning: using only PDCs for group validation !!!\n"); + + /* Main Loop */ + while (fgets (buf, sizeof(buf), stdin)) + { + if (NULL == strchr(buf, '\n')) { + /* too large message received.. skip and deny */ + fprintf(stderr, "%s: ERROR: Too large: %s\n", argv[0], buf); + while (fgets(buf, sizeof(buf), stdin)) { + fprintf(stderr, "%s: ERROR: Too large..: %s\n", argv[0], buf); + if (strchr(buf, '\n') != NULL) + break; + } + goto error; + } + + if ((p = strchr(buf, '\n')) != NULL) + *p = '\0'; /* strip \n */ + if ((p = strchr(buf, '\r')) != NULL) + *p = '\0'; /* strip \r */ + + debug("Got '%s' from Squid (length: %d).\n",buf,strlen(buf)); + + if (buf[0] == '\0') { + fprintf(stderr, "Invalid Request\n"); + goto error; + } + + username = strwordtok(buf, &t); + for (n = 0; (group = strwordtok(NULL, &t)) != NULL; n++) + groups[n] = group; + groups[n] = NULL; + + if (NULL == username) { + fprintf(stderr, "Invalid Request\n"); + goto error; + } + + if ((use_global ? Valid_Global_Groups(username, groups) : Valid_Local_Groups(username, groups))) { + printf ("OK\n"); + } else { +error: + printf ("ERR\n"); + } + err = 0; + } + return 0; +} Index: squid/helpers/external_acl/win32_group/win32_check_group.h diff -u /dev/null squid/helpers/external_acl/win32_group/win32_check_group.h:1.1.6.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/external_acl/win32_group/win32_check_group.h Mon Apr 25 06:28:30 2005 @@ -0,0 +1,79 @@ +/* + * (C) 2002, 2005 Guido Serassio + * Based on previous work of Francesco Chemolli, Robert Collins and Andrew Doran + * + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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. + */ + +#undef debug + +/************* CONFIGURATION ***************/ +/* + * define this if you want debugging + */ +#ifndef DEBUG +#define DEBUG +#endif + +/************* END CONFIGURATION ***************/ + +#include + +#define safe_free(x) if (x) { free(x); x = NULL; } + +/* Debugging stuff */ + +#ifdef __GNUC__ /* this is really a gcc-ism */ +#ifdef DEBUG +#include +#include +static char *__foo; +extern char debug_enabled; +#define debug(X...) if (debug_enabled) { \ + fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \ + ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ + __LINE__);\ + fprintf(stderr,X); } +#else /* DEBUG */ +#define debug(X...) /* */ +#endif /* DEBUG */ +#else /* __GNUC__ */ +extern char debug_enabled; +static void +debug(char *format,...) +{ +#ifdef DEBUG +#ifdef _SQUID_MSWIN_ + if (debug_enabled) { + va_list args; + + va_start(args,format); + fprintf(stderr, "%s[%d]: ", myname, mypid); + vfprintf(stderr, format, args); + fprintf(stderr, "\n"); + va_end(args); + } +#endif /* _SQUID_MSWIN_ */ +#endif /* DEBUG */ +} +#endif /* __GNUC__ */ + + +/* A couple of harmless helper macros */ +#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n"); +#ifdef __GNUC__ +#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); +#else +/* no gcc, no debugging. varargs macros are a gcc extension */ +#define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); +#endif Index: squid/helpers/ntlm_auth/Makefile.am diff -u squid/helpers/ntlm_auth/Makefile.am:1.1.2.1 squid/helpers/ntlm_auth/Makefile.am:1.2.8.1 --- squid/helpers/ntlm_auth/Makefile.am:1.1.2.1 Fri Jun 28 07:46:21 2002 +++ squid/helpers/ntlm_auth/Makefile.am Sat Jun 29 04:05:59 2002 @@ -3,5 +3,5 @@ # $Id$ # -DIST_SUBDIRS = fakeauth no_check SMB winbind +DIST_SUBDIRS = fakeauth no_check SMB winbind NTLMSSP-WIN32 SUBDIRS = @NTLM_AUTH_HELPERS@ Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/.cvsignore diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/.cvsignore Sat Jun 29 04:05:59 2002 @@ -0,0 +1,2 @@ +.cvsignore +Makefile.in Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/Makefile.am diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/Makefile.am:1.1.4.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/Makefile.am Sun Oct 10 12:25:34 2004 @@ -0,0 +1,20 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id$ +# + +libexec_PROGRAMS = win32_ntlm_auth + +win32_ntlm_auth_SOURCES = libntlmssp.c ntlm_auth.c ntlm.h + +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include -I$(top_srcdir)/src +else +INCLUDES = -I. -I$(top_srcdir)/include -I$(top_srcdir)/src +endif + +LDADD = -L$(top_builddir)/lib -lntlmauth -lsspwin32 -lnetapi32 \ + -ladvapi32 -lmiscutil $(CRYPTLIB) $(XTRA_LIBS) + +EXTRA_DIST = readme.txt Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c:1.1.4.11 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c Fri Sep 16 00:57:13 2005 @@ -0,0 +1,379 @@ +/* + * (C) 2002 Guido Serassio + * Based on previous work of Francesco Chemolli and Robert Collins + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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. + */ + +typedef unsigned char uchar; + +#include "util.h" +#include "ntlm.h" +#if HAVE_CTYPE_H +#include +#endif +#include +#include + +/* returns 1 on success, 0 on failure */ +int +Valid_Group(char *UserName, char *Group) +{ + int result = FALSE; + WCHAR wszUserName[UNLEN+1]; // Unicode user name + WCHAR wszGroup[GNLEN+1]; // Unicode Group + + LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pTmpBuf; + DWORD dwLevel = 0; + DWORD dwFlags = LG_INCLUDE_INDIRECT; + DWORD dwPrefMaxLen = -1; + DWORD dwEntriesRead = 0; + DWORD dwTotalEntries = 0; + NET_API_STATUS nStatus; + DWORD i; + DWORD dwTotalCount = 0; + +/* Convert ANSI User Name and Group to Unicode */ + + MultiByteToWideChar(CP_ACP, 0, UserName, + strlen(UserName) + 1, wszUserName, + sizeof(wszUserName) / sizeof(wszUserName[0])); + MultiByteToWideChar(CP_ACP, 0, Group, + strlen(Group) + 1, wszGroup, sizeof(wszGroup) / sizeof(wszGroup[0])); + + /* + * Call the NetUserGetLocalGroups function + * specifying information level 0. + * + * The LG_INCLUDE_INDIRECT flag specifies that the + * function should also return the names of the local + * groups in which the user is indirectly a member. + */ + nStatus = NetUserGetLocalGroups(NULL, + wszUserName, + dwLevel, + dwFlags, + (LPBYTE *) & pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); + /* + * If the call succeeds, + */ + if (nStatus == NERR_Success) { + if ((pTmpBuf = pBuf) != NULL) { + for (i = 0; i < dwEntriesRead; i++) { + if (pTmpBuf == NULL) { + result = FALSE; + break; + } + if (wcscmp(pTmpBuf->lgrui0_name, wszGroup) == 0) { + result = TRUE; + break; + } + pTmpBuf++; + dwTotalCount++; + } + } + } else + result = FALSE; +/* + * Free the allocated memory. + */ + if (pBuf != NULL) + NetApiBufferFree(pBuf); + return result; +} + + +char * AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr) +{ + size_t len; + static char * target; + + len = LsaStr.Length/sizeof(WCHAR) + 1; + + /* allocate buffer for str + null termination */ + safe_free(target); + target = (char *)xmalloc(len); + if (target == NULL) + return NULL; + + /* copy unicode buffer */ + WideCharToMultiByte(CP_ACP, 0, LsaStr.Buffer, LsaStr.Length, target, len, NULL, NULL ); + + /* add null termination */ + target[len-1] = '\0'; + return target; +} + + +char * GetDomainName(void) + +{ + LSA_HANDLE PolicyHandle; + LSA_OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS status; + PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo; + PWKSTA_INFO_100 pwkiWorkstationInfo; + DWORD netret; + char * DomainName = NULL; + + /* + * Always initialize the object attributes to all zeroes. + */ + memset(&ObjectAttributes, '\0', sizeof(ObjectAttributes)); + + /* + * You need the local workstation name. Use NetWkstaGetInfo at level + * 100 to retrieve a WKSTA_INFO_100 structure. + * + * The wki100_computername field contains a pointer to a UNICODE + * string containing the local computer name. + */ + netret = NetWkstaGetInfo(NULL, 100, (LPBYTE *)&pwkiWorkstationInfo); + if (netret == NERR_Success) { + /* + * We have the workstation name in: + * pwkiWorkstationInfo->wki100_computername + * + * Next, open the policy object for the local system using + * the LsaOpenPolicy function. + */ + status = LsaOpenPolicy( + NULL, + &ObjectAttributes, + GENERIC_READ | POLICY_VIEW_LOCAL_INFORMATION, + &PolicyHandle + ); + + /* + * Error checking. + */ + if (status) { + debug("OpenPolicy Error: %ld\n", status); + } else { + + /* + * You have a handle to the policy object. Now, get the + * domain information using LsaQueryInformationPolicy. + */ + status = LsaQueryInformationPolicy(PolicyHandle, + PolicyPrimaryDomainInformation, + (void **)&ppdiDomainInfo); + if (status) { + debug("LsaQueryInformationPolicy Error: %ld\n", status); + } else { + + /* Get name in useable format */ + DomainName = AllocStrFromLSAStr(ppdiDomainInfo->Name); + + /* + * Check the Sid pointer, if it is null, the + * workstation is either a stand-alone computer + * or a member of a workgroup. + */ + if (ppdiDomainInfo->Sid) { + + /* + * Member of a domain. Display it in debug mode. + */ + debug("Member of Domain %s\n",DomainName); + } else { + DomainName = NULL; + } + } + } + + /* + * Clean up all the memory buffers created by the LSA and + * Net* APIs. + */ + NetApiBufferFree(pwkiWorkstationInfo); + LsaFreeMemory((LPVOID)ppdiDomainInfo); + } else + debug("NetWkstaGetInfo Error: %ld\n", netret); + return DomainName; +} + + +int ntlm_errno; + + +/* returns NULL on failure, or a pointer to + * the user's credentials (domain\\username) + * upon success. WARNING. It's pointing to static storage. + * In case of problem sets as side-effect ntlm_errno to one of the + * codes defined in ntlm.h + */ +char * +ntlm_check_auth(ntlm_authenticate * auth, int auth_length) +{ + int rv; + char domain[DNLEN+1]; + char user[UNLEN+1]; + static char credentials[DNLEN+UNLEN+2]; /* we can afford to waste */ + + lstring tmp; + + if (!NTLM_LocalCall) { + + tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->domain); + + if (tmp.str == NULL || tmp.l == 0) { + debug("No domain supplied. Returning no-auth\n"); + ntlm_errno = NTLM_BAD_REQUEST; + return NULL; + } + if (Use_Unicode) { + /* copy unicode buffer */ + WideCharToMultiByte(CP_ACP, 0, (LPCWSTR) tmp.str, tmp.l, domain, DNLEN, NULL, NULL ); + /* add null termination */ + domain[tmp.l / sizeof(WCHAR)] = '\0'; + } else { + if (tmp.l > DNLEN) { + debug("Domain string exceeds %d bytes, rejecting\n", DNLEN); + ntlm_errno = NTLM_BAD_REQUEST; + return NULL; + } + memcpy(domain, tmp.str, tmp.l); + domain[tmp.l] = '\0'; + } + tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->user); + if (tmp.str == NULL || tmp.l == 0) { + debug("No username supplied. Returning no-auth\n"); + ntlm_errno = NTLM_BAD_REQUEST; + return NULL; + } + if (Use_Unicode) { + /* copy unicode buffer */ + WideCharToMultiByte(CP_ACP, 0, (LPCWSTR) tmp.str, tmp.l, user, UNLEN, NULL, NULL ); + /* add null termination */ + user[tmp.l / sizeof(WCHAR)] = '\0'; + } else { + if (tmp.l > UNLEN) { + debug("Username string exceeds %d bytes, rejecting\n", UNLEN); + ntlm_errno = NTLM_BAD_REQUEST; + return NULL; + } + memcpy(user, tmp.str, tmp.l); + user[tmp.l] = '\0'; + } + debug("checking domain: '%s', user: '%s'\n", domain, user); + + } else + debug("checking local user\n"); + + rv = SSP_ValidateCredentials(auth, auth_length, credentials); + + debug("Login attempt had result %d\n", rv); + + if (!rv) { /* failed */ + ntlm_errno = NTLM_SSPI_ERROR; + return NULL; + } + + if (UseAllowedGroup) { + if (!Valid_Group(credentials, NTAllowedGroup)) { + ntlm_errno = NTLM_BAD_NTGROUP; + debug("User %s not in allowed Group %s\n", credentials, NTAllowedGroup); + return NULL; + } + } + if (UseDisallowedGroup) { + if (Valid_Group(credentials, NTDisAllowedGroup)) { + ntlm_errno = NTLM_BAD_NTGROUP; + debug("User %s is in denied Group %s\n", credentials, NTDisAllowedGroup); + return NULL; + } + } + + debug("credentials: %s\n", credentials); + return credentials; +} + + +const char * +ntlm_make_negotiate(void) +{ + ntlm_negotiate ne; + const char *encoded; + memset(&ne, 0, sizeof(ntlm_negotiate)); /* reset */ + memcpy(ne.signature, "NTLMSSP", 8); /* set the signature */ + ne.type = WSWAP(NTLM_NEGOTIATE); /* this is a challenge */ + ne.flags = WSWAP( + NEGOTIATE_ALWAYS_SIGN | + NEGOTIATE_USE_NTLM | + NEGOTIATE_USE_LM | + NEGOTIATE_ASCII | + 0 + ); + encoded = base64_encode_bin((char *) &ne, NEGOTIATE_LENGTH); + debug("Negotiate packet not supplied - self generated\n"); + return encoded; +} + + +void hex_dump(void *data, int size) +{ + /* dumps size bytes of *data to stdout. Looks like: + * [0000] 75 6E 6B 6E 6F 77 6E 20 + * 30 FF 00 00 00 00 39 00 unknown 0.....9. + * (in a single line of course) + */ + + if (debug_enabled) { + unsigned char *p = data; + unsigned char c; + int n; + char bytestr[4] = {0}; + char addrstr[10] = {0}; + char hexstr[ 16*3 + 5] = {0}; + char charstr[16*1 + 5] = {0}; + for(n=1;n<=size;n++) { + if (n%16 == 1) { + /* store address for this line */ + snprintf(addrstr, sizeof(addrstr), "%.4x", + ((unsigned int)p-(unsigned int)data) ); + } + + c = *p; + if (isalnum(c) == 0) { + c = '.'; + } + + /* store hex str (for left side) */ + snprintf(bytestr, sizeof(bytestr), "%02X ", *p); + strncat(hexstr, bytestr, sizeof(hexstr)-strlen(hexstr)-1); + + /* store char str (for right side) */ + snprintf(bytestr, sizeof(bytestr), "%c", c); + strncat(charstr, bytestr, sizeof(charstr)-strlen(charstr)-1); + + if(n%16 == 0) { + /* line completed */ + fprintf(stderr, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); + hexstr[0] = 0; + charstr[0] = 0; + } else if(n%8 == 0) { + /* half line: add whitespaces */ + strncat(hexstr, " ", sizeof(hexstr)-strlen(hexstr)-1); + strncat(charstr, " ", sizeof(charstr)-strlen(charstr)-1); + } + p++; /* next byte */ + } + + if (strlen(hexstr) > 0) { + /* print rest of buffer if not empty */ + fprintf(stderr, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); + } + } +} + Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm.h diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm.h:1.1.4.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm.h Fri Sep 16 00:57:13 2005 @@ -0,0 +1,115 @@ +/* + * (C) 2002 Guido Serassio + * Based on previous work of Francesco Chemolli, Robert Collins and Andrew Doran + * + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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. + */ + +#ifndef _NTLM_H_ +#define _NTLM_H_ + +#include "sspwin32.h" +#include +#include +#include +#include "ntlmauth.h" +#undef debug + +/************* CONFIGURATION ***************/ +/* + * define this if you want debugging + */ +#ifndef DEBUG +#define DEBUG +#endif + +#define FAIL_DEBUG 0 + +/************* END CONFIGURATION ***************/ + +#include + +extern int debug_enabled; +#ifdef FAIL_DEBUG +extern int fail_debug_enabled; +#endif + +/* Debugging stuff */ + +#ifdef __GNUC__ /* this is really a gcc-ism */ +#ifdef DEBUG +#include +#include +static char *__foo; +#define debug(X...) if (debug_enabled) { \ + fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \ + ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\ + __LINE__);\ + fprintf(stderr,X); } +#else /* DEBUG */ +#define debug(X...) /* */ +#endif /* DEBUG */ +#else /* __GNUC__ */ +static void +debug(char *format,...) +{ +#ifdef DEBUG +#ifdef _SQUID_MSWIN_ + if (debug_enabled || fail_debug_enabled) { + va_list args; + + va_start(args,format); + fprintf(stderr, "ntlm-auth[%d]: ",getpid()); + vfprintf(stderr, format, args); + va_end(args); +#ifdef FAIL_DEBUG + fail_debug_enabled = 0; +#endif + } +#endif /* _SQUID_MSWIN_ */ +#endif /* DEBUG */ +} +#endif /* __GNUC__ */ + + +/* A couple of harmless helper macros */ +#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n"); +#ifdef __GNUC__ +#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); +#else +/* no gcc, no debugging. varargs macros are a gcc extension */ +#define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); +#endif + +extern char * NTAllowedGroup; +extern char * NTDisAllowedGroup; +extern int UseDisallowedGroup; +extern int UseAllowedGroup; +extern int ntlm_errno; + +#define NTLM_NO_ERROR 0 +#define NTLM_SSPI_ERROR 1 +#define NTLM_BAD_NTGROUP 2 +#define NTLM_BAD_REQUEST 3 + +#define NEGOTIATE_LENGTH 16 + +extern void uc(char *); + +extern const char * ntlm_make_negotiate(void); +extern char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length); +extern void hex_dump(void *, int); + +#define safe_free(x) if (x) { free(x); x = NULL; } + +#endif /* _NTLM_H_ */ Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c:1.1.4.20 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c Fri Sep 16 00:57:13 2005 @@ -0,0 +1,421 @@ +/* + * win32_ntlm_auth: helper for NTLM Authentication for Squid Cache + * + * (C)2002,2003 Guido Serassio - Acme Consulting S.r.l. + * + * Authors: + * Guido Serassio + * Acme Consulting S.r.l., Italy + * + * With contributions from others mentioned in the change history section + * below. + * + * Based on previous work of Francesco Chemolli and Robert Collins. + * + * Dependencies: Windows NT4 SP4 and later. + * + * 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. + * + * History: + * + * Version 1.21 + * 21-02-2004 Guido Serassio + * Removed control of use of NTLM NEGOTIATE packet from + * command line, now the support is automatic. + * Version 1.20 + * 30-11-2003 Guido Serassio + * Added support for NTLM local calls. + * Added control of use of NTLM NEGOTIATE packet from + * command line. + * Updated documentation. + * Version 1.10 + * 07-09-2003 Guido Serassio + * Now is true NTLM authenticator. + * More debug info. + * Updated documentation. + * Version 1.0 + * 29-06-2002 Guido Serassio + * First release. + * + * + */ + +#include "util.h" +#if HAVE_GETOPT_H +#include +#endif +#include "ntlm.h" +#if HAVE_CTYPE_H +#include +#endif + +#define BUFFER_SIZE 10240 + +#ifdef NTLM_FAIL_OPEN +int last_ditch_enabled = 0; +#endif + +int debug_enabled = 0; +int NTLM_packet_debug_enabled = 0; + +static int have_challenge; + +char * NTAllowedGroup; +char * NTDisAllowedGroup; +int UseDisallowedGroup = 0; +int UseAllowedGroup = 0; +#ifdef FAIL_DEBUG +int fail_debug_enabled = 0; +#endif + +/* makes a null-terminated string upper-case. Changes CONTENTS! */ +void +uc(char *string) +{ + char *p = string, c; + while ((c = *p)) { + *p = toupper(c); + p++; + } +} + +/* makes a null-terminated string lower-case. Changes CONTENTS! */ +static void +lc(char *string) +{ + char *p = string, c; + while ((c = *p)) { + *p = tolower(c); + p++; + } +} + +void +helperfail(const char *reason) +{ +#ifdef FAIL_DEBUG + fail_debug_enabled =1; +#endif + SEND2("BH %s", reason); +} + +/* + options: + -d enable debugging. + -v enable verbose NTLM packet debugging. + -l if specified, changes behavior on failures to last-ditch. + -A can specify a Windows Local Group name allowed to authenticate. + -D can specify a Windows Local Group name not allowed to authenticate. + */ +char *my_program_name = NULL; + +void +usage() +{ + fprintf(stderr, +#ifdef NTLM_FAIL_OPEN + "Usage: %s [-d] [-v] [-A|D LocalUserGroup] [-l] [-h]\n" +#else + "Usage: %s [-d] [-v] [-A|D LocalUserGroup] [-h]\n" +#endif + " -d enable debugging.\n" + " -v enable verbose NTLM packet debugging.\n" +#ifdef NTLM_FAIL_OPEN + " -l if specified, changes behavior on failures to last-ditch\n" +#endif + " -A specify a Windows Local Group name allowed to authenticate\n" + " -D specify a Windows Local Group name not allowed to authenticate\n" + " -h this message\n\n", + my_program_name); +} + + +void +process_options(int argc, char *argv[]) +{ + int opt, had_error = 0; + + opterr =0; +#ifdef NTLM_FAIL_OPEN + while (-1 != (opt = getopt(argc, argv, "hdvlA:D:"))) { +#else + while (-1 != (opt = getopt(argc, argv, "hdvA:D:"))) { +#endif + switch (opt) { + case 'A': + safe_free(NTAllowedGroup); + NTAllowedGroup=xstrdup(optarg); + UseAllowedGroup = 1; + break; + case 'D': + safe_free(NTDisAllowedGroup); + NTDisAllowedGroup=xstrdup(optarg); + UseDisallowedGroup = 1; + break; +#ifdef NTLM_FAIL_OPEN + case 'l': + last_ditch_enabled = 1; + break; +#endif + case 'd': + debug_enabled = 1; + break; + case 'v': + debug_enabled = 1; + NTLM_packet_debug_enabled = 1; + break; + case 'h': + usage(); + exit(0); + case '?': + opt = optopt; + /* fall thru to default */ + default: + fprintf(stderr, "unknown option: -%c. Exiting\n", opt); + usage(); + had_error = 1; + } + } + if (had_error) + exit(1); +} + + +const char * +obtain_challenge(ntlm_negotiate * nego, int nego_length) +{ + const char *ch = NULL; + + debug("attempting SSPI challenge retrieval\n"); + ch = SSP_MakeChallenge(nego, nego_length); + if (ch) { + debug("Got it\n"); + return ch; /* All went OK, returning */ + } + return NULL; +} + + +int +manage_request() +{ + ntlmhdr *fast_header; + char buf[BUFFER_SIZE]; + char helper_command[3]; + char *c, *decoded, *cred; + int plen; + int oversized = 0; + char * ErrorMessage; + +try_again: + if (fgets(buf, BUFFER_SIZE, stdin) == NULL) + return 0; + + c = memchr(buf, '\n', BUFFER_SIZE); /* safer against overrun than strchr */ + if (c) { + if (oversized) { + helperfail("illegal request received"); + fprintf(stderr, "Illegal request received: '%s'\n", buf); + return 1; + } + *c = '\0'; + } else { + fprintf(stderr, "No newline in '%s'\n", buf); + oversized = 1; + goto try_again; + } + if ((strlen(buf) > 3) && NTLM_packet_debug_enabled) { + decoded = base64_decode(buf + 3); + strncpy(helper_command, buf, 2); + debug("Got '%s' from Squid with data:\n", helper_command); + hex_dump(decoded, ((strlen(buf) - 3) * 3) / 4); + } else + debug("Got '%s' from Squid\n", buf); + if (memcmp(buf, "YR", 2) == 0) { /* refresh-request */ + /* figure out what we got */ + if (strlen(buf) > 3) + decoded = base64_decode(buf + 3); + else + decoded = base64_decode(ntlm_make_negotiate()); + /* Note: we don't need to manage memory at this point, since + * base64_decode returns a pointer to static storage. + */ + if (!decoded) { /* decoding failure, return error */ + SEND("NA Packet format error, couldn't base64-decode"); + return 1; + } + /* fast-track-decode request type. */ + fast_header = (struct _ntlmhdr *) decoded; + + /* sanity-check: it IS a NTLMSSP packet, isn't it? */ + if (memcmp(fast_header->signature, "NTLMSSP", 8) != 0) { + SEND("NA Broken authentication packet"); + return 1; + } + switch (fast_header->type) { + case NTLM_NEGOTIATE: + /* Obtain challenge against SSPI */ + if (strlen(buf) > 3) + plen = (strlen(buf) - 3) * 3 / 4; /* we only need it here. Optimization */ + else + plen = NEGOTIATE_LENGTH; + if ((c = (char *) obtain_challenge((ntlm_negotiate *) decoded, plen)) != NULL ) + { + if (NTLM_packet_debug_enabled) { + printf("TT %s\n",c); + decoded = base64_decode(c); + debug("sending 'TT' to squid with data:\n"); + hex_dump(decoded, (strlen(c) * 3) / 4); + if (NTLM_LocalCall) + debug("NTLM Local Call detected\n"); + } else { + SEND2("TT %s", c); + } + have_challenge = 1; + } else + helperfail("can't obtain challenge"); + return 1; + /* notreached */ + case NTLM_CHALLENGE: + SEND + ("NA Got a challenge. We refuse to have our authority disputed"); + return 1; + /* notreached */ + case NTLM_AUTHENTICATE: + SEND("NA Got authentication request instead of negotiate request"); + return 1; + /* notreached */ + default: + helperfail("unknown refresh-request packet type"); + return 1; + } + return 1; + } + if (memcmp(buf, "KK ", 3) == 0) { /* authenticate-request */ + if (!have_challenge) { + helperfail("invalid challenge"); + return 1; + } + /* figure out what we got */ + decoded = base64_decode(buf + 3); + /* Note: we don't need to manage memory at this point, since + * base64_decode returns a pointer to static storage. + */ + + if (!decoded) { /* decoding failure, return error */ + SEND("NA Packet format error, couldn't base64-decode"); + return 1; + } + /* fast-track-decode request type. */ + fast_header = (struct _ntlmhdr *) decoded; + + /* sanity-check: it IS a NTLMSSP packet, isn't it? */ + if (memcmp(fast_header->signature, "NTLMSSP", 8) != 0) { + SEND("NA Broken authentication packet"); + return 1; + } + switch (fast_header->type) { + case NTLM_NEGOTIATE: + SEND("NA Invalid negotiation request received"); + return 1; + /* notreached */ + case NTLM_CHALLENGE: + SEND + ("NA Got a challenge. We refuse to have our authority disputed"); + return 1; + /* notreached */ + case NTLM_AUTHENTICATE: + /* check against SSPI */ + plen = (strlen(buf) - 3) * 3 / 4; /* we only need it here. Optimization */ + cred = ntlm_check_auth((ntlm_authenticate *) decoded, plen); + have_challenge = 0; + if (cred == NULL) { +#ifdef FAIL_DEBUG + fail_debug_enabled =1; +#endif + switch (ntlm_errno) { + case NTLM_BAD_NTGROUP: + SEND("NA Incorrect Group Membership"); + return 1; + case NTLM_BAD_REQUEST: + SEND("NA Incorrect Request Format"); + return 1; + case NTLM_SSPI_ERROR: + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &ErrorMessage, + 0, + NULL); + if (ErrorMessage[strlen(ErrorMessage) - 1] == '\n') + ErrorMessage[strlen(ErrorMessage) - 1] = '\0'; + if (ErrorMessage[strlen(ErrorMessage) - 1] == '\r') + ErrorMessage[strlen(ErrorMessage) - 1] = '\0'; + SEND2("NA %s", ErrorMessage); + LocalFree(ErrorMessage); + return 1; + default: + SEND("NA Unknown Error"); + return 1; + } + } + lc(cred); /* let's lowercase them for our convenience */ + SEND2("AF %s", cred); + return 1; + default: + helperfail("unknown authentication packet type"); + return 1; + } + return 1; + } else { /* not an auth-request */ + helperfail("illegal request received"); + fprintf(stderr, "Illegal request received: '%s'\n", buf); + return 1; + } + helperfail("detected protocol error"); + return 1; +/********* END ********/ +} + +int +main(int argc, char *argv[]) +{ + my_program_name = argv[0]; + + process_options(argc, argv); + + debug("%s build " __DATE__ ", " __TIME__ " starting up...\n", my_program_name); + + if (LoadSecurityDll(SSP_NTLM) == NULL) { + fprintf(stderr, "FATAL, can't initialize SSPI, exiting.\n"); + exit(1); + } + debug("SSPI initialized OK\n"); + + atexit(UnloadSecurityDll); + + /* initialize FDescs */ + setbuf(stdout, NULL); + setbuf(stderr, NULL); + + while (manage_request()) { + /* everything is done within manage_request */ + } + exit(0); +} Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/readme.txt diff -u /dev/null squid/helpers/ntlm_auth/NTLMSSP-WIN32/readme.txt:1.1.4.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/readme.txt Sat Feb 28 00:35:14 2004 @@ -0,0 +1,70 @@ +win32_ntlm_auth.exe + +Native Windows NTLM/NTLMv2 authenticator for Squid 2.5 with +automatic support for NTLM NEGOTIATE packets. + +===== +Usage +===== + +win32_ntlm_auth [-d] [-v] [-A|D LocalUserGroup] [-h] + +-d enables debugging. +-v enables verbose NTLM packet debugging. +-A specify a Windows Local Group name allowed to authenticate. +-D specify a Windows Local Group name not allowed to authenticate. +-h print program usage + +This is released under the GNU General Public License + +============== +Allowing Users +============== + +Users that are allowed to access the web proxy must have the Windows NT +User Rights "logon from the network". +Optionally the authenticator can verify the NT LOCAL group membership of +the user against the User Group specified in the Authenticator's command +line. +This can be accomplished creating a local user group on the NT machine, +grant the privilege, and adding users to it, it works only with MACHINE +Local Groups, not Domain Local Groups. +Better group checking is available with External Acl, see win32_check_group +documentation. + +The use of NTLM NEGOTIATE packet allow full NTLM/NTLMv2 support, but +Squid too must be configured to use NTLM NEGOTIATE, see squid.conf. + +Squid.conf typical minimal required changes: + +auth_param ntlm program c:/squid/libexec/win32_ntlm_auth.exe +auth_param ntlm children 5 +auth_param ntlm max_challenge_reuses 0 +auth_param ntlm max_challenge_lifetime 2 minutes +auth_param ntlm use_ntlm_negotiate on + +acl password proxy_auth REQUIRED + +http_access allow password +http_access deny all + +When using "use_ntlm_negotiate on" +max_challenge_reuses and max_challenge_lifetime parameters must be specified +but they are are ignored. + +Refer to Squid documentation for more details. + +Currently Internet Explorer has some problems with ftp:// URLs when handling +internal Squid FTP icons. The following squid.conf ACL works around this: + +acl internal_icons urlpath_regex -i /squid-internal-static/icons/ + +http_access allow our_networks internal_icons <== BEFORE authentication ACL !!! + + +=============== +Contact details +=============== + +To contact the maintainer of this package, e-mail on squidnt@acmeconsulting.it. +The latest version may be found on http://www.acmeconsulting.it/SquidNT.htm. Index: squid/helpers/ntlm_auth/fakeauth/Makefile.am diff -u squid/helpers/ntlm_auth/fakeauth/Makefile.am:1.1.2.1 squid/helpers/ntlm_auth/fakeauth/Makefile.am:1.2.8.2 --- squid/helpers/ntlm_auth/fakeauth/Makefile.am:1.1.2.1 Fri Jun 28 07:46:21 2002 +++ squid/helpers/ntlm_auth/fakeauth/Makefile.am Sun Apr 13 08:12:25 2003 @@ -8,6 +8,11 @@ libexec_PROGRAMS = fakeauth_auth fakeauth_auth_SOURCES = fakeauth_auth.c ntlm.h +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I$(top_srcdir)/src +else INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_srcdir)/src/ +endif LDADD = -L$(top_builddir)/lib -lmiscutil $(CRYPTLIB) $(XTRA_LIBS) Index: squid/include/config.h diff -u squid/include/config.h:1.5.10.5 squid/include/config.h:1.5.18.8 --- squid/include/config.h:1.5.10.5 Fri Apr 22 19:15:35 2005 +++ squid/include/config.h Sat May 21 08:42:14 2005 @@ -106,6 +106,7 @@ #elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) #define _SQUID_MSWIN_ +#include "squid-mswin.h" #elif defined(__APPLE__) #define _SQUID_APPLE_ @@ -180,7 +181,7 @@ #define squid_srandom srand #endif -#if __GNUC__ +#if __GNUC__ && !defined(_SQUID_MSWIN_) #define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2))) #define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3))) #define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4))) Index: squid/include/radix.h diff -u squid/include/radix.h:1.7 squid/include/radix.h:1.7.14.2 --- squid/include/radix.h:1.7 Tue Nov 13 14:19:33 2001 +++ squid/include/radix.h Sat Mar 23 02:35:24 2002 @@ -153,6 +153,8 @@ extern struct squid_radix_node *squid_rn_search(void *, struct squid_radix_node *); extern struct squid_radix_node *squid_rn_search_m(void *, struct squid_radix_node *, void *); extern struct squid_radix_node *squid_rn_lookup(void *, void *, struct squid_radix_node_head *); +#ifndef min #define min(x,y) ((x)<(y)? (x) : (y)) +#endif #endif /* SQUID_RADIX_H */ Index: squid/include/sspwin32.h diff -u /dev/null squid/include/sspwin32.h:1.1.4.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/include/sspwin32.h Sun Nov 30 03:44:38 2003 @@ -0,0 +1,47 @@ +/* + * (C) 2002 Guido Serassio + * Based on previous work of Francesco Chemolli, Robert Collins and Andrew Doran + * + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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. + */ + +#ifndef _LIBSSPWIN32_H_ +#define _LIBSSPWIN32_H_ +#define SECURITY_WIN32 +#define NTLM_PACKAGE_NAME "NTLM" + +#ifdef _SQUID_CYGWIN_ +#include +#define _T(x) TEXT(x) +#else +#include +#endif +#include +#include +#include + +#define WINNT_SECURITY_DLL "security.dll" +#define WIN2K_SECURITY_DLL "secur32.dll" + +#define SSP_BASIC 1 +#define SSP_NTLM 2 + +HMODULE LoadSecurityDll(int); +void UnloadSecurityDll(void); +BOOL WINAPI SSP_LogonUser(PTSTR, PTSTR, PTSTR); +BOOL WINAPI SSP_ValidateCredentials(PVOID, int, char *); +const char * WINAPI SSP_MakeChallenge(PVOID, int); + +extern BOOL Use_Unicode; +extern BOOL NTLM_LocalCall; +#endif /* LIBSSPWIN32_H_ */ Index: squid/include/util.h diff -u squid/include/util.h:1.10.6.1 squid/include/util.h:1.10.14.12 --- squid/include/util.h:1.10.6.1 Fri May 12 09:51:32 2006 +++ squid/include/util.h Sat May 13 05:26:30 2006 @@ -59,7 +59,6 @@ extern char *xstrdup(const char *); extern char *xstrndup(const char *, size_t); extern const char *xstrerror(void); -extern const char *xbstrerror(int); extern int tvSubMsec(struct timeval, struct timeval); extern int tvSubUsec(struct timeval, struct timeval); extern double tvSubDsec(struct timeval, struct timeval); @@ -123,4 +122,32 @@ */ int statMemoryAccounted(void); +/* CygWin & Windows NT Port */ +/* win32lib.c */ +#ifdef _SQUID_MSWIN_ +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +extern int64_t WIN32_strtoll(const char *nptr, char **endptr, int base); +#endif +extern int chroot (const char *); +extern int ftruncate(int, off_t); +extern int gettimeofday(struct timeval * ,struct timezone *); +extern int kill(pid_t, int); +extern int statfs(const char *, struct statfs *); +extern int truncate(const char *, off_t); +extern const char * wsastrerror(int); +extern struct passwd *getpwnam(char *); +extern struct group *getgrnam(char *); +extern uid_t geteuid(void); +extern uid_t getuid(void); +extern int setuid(uid_t); +extern int seteuid(uid_t); +extern gid_t getgid(void); +extern gid_t getegid(void); +extern int setgid(gid_t); +extern int setegid(gid_t); +extern const char *WIN32_strerror(int); +extern void WIN32_maperror(unsigned long); +extern int WIN32_Close_FD_Socket (int); +#endif + #endif /* SQUID_UTIL_H */ Index: squid/lib/Makefile.am diff -u squid/lib/Makefile.am:1.4 squid/lib/Makefile.am:1.4.10.7 --- squid/lib/Makefile.am:1.4 Wed Nov 21 15:48:57 2001 +++ squid/lib/Makefile.am Sun Apr 13 08:22:09 2003 @@ -13,18 +13,34 @@ else MD5SOURCE= endif +if ENABLE_WIN32SPECIFIC +LIBSSPWIN32=libsspwin32.a +else +LIBSSPWIN32= +endif + +if ENABLE_MINGW32SPECIFIC +WIN32SRC = win32lib.c +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include -I$(top_srcdir)/src +else +WIN32SRC= +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src +endif EXTRA_LIBRARIES = \ libdlmalloc.a \ - libregex.a + libregex.a \ + libsspwin32.a noinst_LIBRARIES = \ @LIBDLMALLOC@ \ libmiscutil.a \ libntlmauth.a \ + $(LIBSSPWIN32) \ @LIBREGEX@ EXTRA_libmiscutil_a_SOURCES = \ md5.c \ - snprintf.c + snprintf.c \ + win32lib.c libmiscutil_a_SOURCES = \ Array.c \ base64.c \ @@ -45,7 +61,8 @@ Stack.c \ stub_memaccount.c \ util.c \ - uudecode.c + uudecode.c \ + $(WIN32SRC) libmiscutil_a_LIBADD = \ @LIBOBJS@ # $(top_srcdir)/include/version.h should be a dependency @@ -57,5 +74,6 @@ ntlmauth.c libntlmauth_a_LIBADD = \ @LIBOBJS@ +libsspwin32_a_SOURCES = \ + sspwin32.c -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include Index: squid/lib/getopt.c diff -u /dev/null squid/lib/getopt.c:1.1.108.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/lib/getopt.c Sun Oct 27 02:42:20 2002 @@ -0,0 +1,501 @@ +/* $NetBSD: getopt_long.c,v 1.12 2001/04/24 09:07:43 joda Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "cdefs.h" + +/*#include "namespace.h"*/ + +#include +#include +/*#include */ +#include +#include +#include "getopt.h" +#include +#include + +#define REPLACE_GETOPT + +#define _DIAGASSERT(x) do {} while (0) + +#ifdef REPLACE_GETOPT +#ifdef __weak_alias +__weak_alias(getopt,_getopt) +#endif +int opterr = 1; /* if error message should be printed */ +int optind = 1; /* index into parent argv vector */ +int optopt = '?'; /* character checked for validity */ +int optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ +#endif + +#ifdef __weak_alias +__weak_alias(getopt_long,_getopt_long) +#endif + +#ifndef __CYGWIN__ +#define __progname __argv[0] +#else +extern char __declspec(dllimport) *__progname; +#endif + +#define IGNORE_FIRST (*options == '-' || *options == '+') +#define PRINT_ERROR ((opterr) && ((*options != ':') \ + || (IGNORE_FIRST && options[1] != ':'))) +#if defined(__CYGWIN__) || defined(__MINGW32__) +# define IS_POSIXLY_CORRECT (1) +#else +# define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) +#endif + +#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) +/* XXX: GNU ignores PC if *options == '-' */ +#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') + +/* return values */ +#define BADCH (int)'?' +#define BADARG ((IGNORE_FIRST && options[1] == ':') \ + || (*options == ':') ? (int)':' : (int)'?') +#define INORDER (int)1 + +#define EMSG "" + +static int getopt_internal __P((int, char * const *, const char *)); +static int gcd __P((int, int)); +static void permute_args __P((int, int, int, char * const *)); + +static const char *place = EMSG; /* option letter processing */ + +/* XXX: set optreset to 1 rather than these two */ +static int nonopt_start = -1; /* first non option argument (for permute) */ +static int nonopt_end = -1; /* first option after non options (for permute) */ + +/* Error messages */ +static const char recargchar[] = "option requires an argument -- %c"; +static const char recargstring[] = "option requires an argument -- %s"; +static const char ambig[] = "ambiguous option -- %.*s"; +static const char noarg[] = "option doesn't take an argument -- %.*s"; +static const char illoptchar[] = "unknown option -- %c"; +static const char illoptstring[] = "unknown option -- %s"; + +static void +_vwarnx(const char *fmt, va_list ap) +{ + (void)fprintf(stderr, "%s: ", __progname); + if (fmt != NULL) + (void)vfprintf(stderr, fmt, ap); + (void)fprintf(stderr, "\n"); +} + +static void +warnx(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + _vwarnx(fmt, ap); + va_end(ap); +} + +/* + * Compute the greatest common divisor of a and b. + */ +static int +gcd(a, b) + int a; + int b; +{ + int c; + + c = a % b; + while (c != 0) { + a = b; + b = c; + c = a % b; + } + + return b; +} + +/* + * Exchange the block from nonopt_start to nonopt_end with the block + * from nonopt_end to opt_end (keeping the same order of arguments + * in each block). + */ +static void +permute_args(nonopt_start, nonopt_end, opt_end, nargv) + int nonopt_start; + int nonopt_end; + int opt_end; + char * const *nargv; +{ + int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; + char *swap; + + _DIAGASSERT(nargv != NULL); + + /* + * compute lengths of blocks and number and size of cycles + */ + nnonopts = nonopt_end - nonopt_start; + nopts = opt_end - nonopt_end; + ncycle = gcd(nnonopts, nopts); + cyclelen = (opt_end - nonopt_start) / ncycle; + + for (i = 0; i < ncycle; i++) { + cstart = nonopt_end+i; + pos = cstart; + for (j = 0; j < cyclelen; j++) { + if (pos >= nonopt_end) + pos -= nnonopts; + else + pos += nopts; + swap = nargv[pos]; + /* LINTED const cast */ + ((char **) nargv)[pos] = nargv[cstart]; + /* LINTED const cast */ + ((char **)nargv)[cstart] = swap; + } + } +} + +/* + * getopt_internal -- + * Parse argc/argv argument vector. Called by user level routines. + * Returns -2 if -- is found (can be long option or end of options marker). + */ +static int +getopt_internal(int nargc, char *const * nargv, const char *options) +{ + char *oli; /* option letter list index */ + int optchar; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + optarg = NULL; + + /* + * XXX Some programs (like rsyncd) expect to be able to + * XXX re-initialize optind to 0 and have getopt_long(3) + * XXX properly function again. Work around this braindamage. + */ + if (optind == 0 && optreset == 0) + optind = 1; + + if (optreset) + nonopt_start = nonopt_end = -1; +start: + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc) { /* end of argument vector */ + place = EMSG; + if (nonopt_end != -1) { + /* do permutation, if we have to */ + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + else if (nonopt_start != -1) { + /* + * If we skipped non-options, set optind + * to the first of them. + */ + optind = nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((*(place = nargv[optind]) != '-') + || (place[1] == '\0')) { /* found non-option */ + place = EMSG; + if (IN_ORDER) { + /* + * GNU extension: + * return non-option as argument to option 1 + */ + optarg = nargv[optind++]; + return INORDER; + } + if (!PERMUTE) { + /* + * if no permutation wanted, stop parsing + * at first non-option + */ + return -1; + } + /* do permutation */ + if (nonopt_start == -1) + nonopt_start = optind; + else if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + nonopt_start = optind - + (nonopt_end - nonopt_start); + nonopt_end = -1; + } + optind++; + /* process next argument */ + goto start; + } + if (nonopt_start != -1 && nonopt_end == -1) + nonopt_end = optind; + if (place[1] && *++place == '-') { /* found "--" */ + place++; + return -2; + } + } + if ((optchar = (int)*place++) == (int)':' || + (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) { + /* option letter unknown or ':' */ + if (!*place) + ++optind; + if (PRINT_ERROR) + warnx(illoptchar, optchar); + optopt = optchar; + return BADCH; + } + if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ + /* XXX: what if no long options provided (called by getopt)? */ + if (*place) + return -2; + + if (++optind >= nargc) { /* no arg */ + place = EMSG; + if (PRINT_ERROR) + warnx(recargchar, optchar); + optopt = optchar; + return BADARG; + } else /* white space */ + place = nargv[optind]; + /* + * Handle -W arg the same as --arg (which causes getopt to + * stop parsing). + */ + return -2; + } + if (*++oli != ':') { /* doesn't take argument */ + if (!*place) + ++optind; + } else { /* takes (optional) argument */ + optarg = NULL; + if (*place) /* no white space */ + optarg = (char *) place; + /* XXX: disable test for :: if PC? (GNU doesn't) */ + else if (oli[1] != ':') { /* arg not optional */ + if (++optind >= nargc) { /* no arg */ + place = EMSG; + if (PRINT_ERROR) + warnx(recargchar, optchar); + optopt = optchar; + return BADARG; + } else + optarg = nargv[optind]; + } + place = EMSG; + ++optind; + } + /* dump back option letter */ + return optchar; +} + +#ifdef REPLACE_GETOPT +/* + * getopt -- + * Parse argc/argv argument vector. + * + * [eventually this will replace the real getopt] + */ +int +getopt(int nargc, char * const *nargv, const char *options) +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + ++optind; + /* + * We found an option (--), so if we skipped non-options, + * we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, optind, + nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + retval = -1; + } + return retval; +} +#endif + +/* + * getopt_long -- + * Parse argc/argv argument vector. + */ +int +getopt_long(int nargc, char * const *nargv, const char *options, + const struct option *long_options, int *idx) +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + _DIAGASSERT(long_options != NULL); + /* idx may be NULL */ + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + char *current_argv, *has_equal; + size_t current_argv_len; + int i, match; + + current_argv = (char *) place; + match = -1; + + optind++; + place = EMSG; + + if (*current_argv == '\0') { /* found "--" */ + /* + * We found an option (--), so if we skipped + * non-options, we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((has_equal = strchr(current_argv, '=')) != NULL) { + /* argument found (--option=arg) */ + current_argv_len = has_equal - current_argv; + has_equal++; + } else + current_argv_len = strlen(current_argv); + + for (i = 0; long_options[i].name; i++) { + /* find matching long option */ + if (strncmp(current_argv, long_options[i].name, + current_argv_len)) + continue; + + if (strlen(long_options[i].name) == + (unsigned)current_argv_len) { + /* exact match */ + match = i; + break; + } + if (match == -1) /* partial match */ + match = i; + else { + /* ambiguous abbreviation */ + if (PRINT_ERROR) + warnx(ambig, (int)current_argv_len, + current_argv); + optopt = 0; + return BADCH; + } + } + if (match != -1) { /* option found */ + if (long_options[match].has_arg == no_argument + && has_equal) { + if (PRINT_ERROR) + warnx(noarg, (int)current_argv_len, + current_argv); + /* + * XXX: GNU sets optopt to val regardless of + * flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + return BADARG; + } + if (long_options[match].has_arg == required_argument || + long_options[match].has_arg == optional_argument) { + if (has_equal) + optarg = has_equal; + else if (long_options[match].has_arg == + required_argument) { + /* + * optional argument doesn't use + * next nargv + */ + optarg = nargv[optind++]; + } + } + if ((long_options[match].has_arg == required_argument) + && (optarg == NULL)) { + /* + * Missing argument; leading ':' + * indicates no error should be generated + */ + if (PRINT_ERROR) + warnx(recargstring, current_argv); + /* + * XXX: GNU sets optopt to val regardless + * of flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + --optind; + return BADARG; + } + } else { /* unknown option */ + if (PRINT_ERROR) + warnx(illoptstring, current_argv); + optopt = 0; + return BADCH; + } + if (long_options[match].flag) { + *long_options[match].flag = long_options[match].val; + retval = 0; + } else + retval = long_options[match].val; + if (idx) + *idx = match; + } + return retval; +} Index: squid/lib/md5.c diff -u squid/lib/md5.c:1.7 squid/lib/md5.c:1.7.10.2 --- squid/lib/md5.c:1.7 Wed Nov 21 15:48:57 2001 +++ squid/lib/md5.c Sat Jan 3 06:47:25 2004 @@ -32,6 +32,7 @@ #include "config.h" +#if !USE_SSL #if HAVE_STRING_H #include #endif @@ -356,3 +357,4 @@ } #endif +#endif Index: squid/lib/rfc1123.c diff -u squid/lib/rfc1123.c:1.6.6.3 squid/lib/rfc1123.c:1.6.14.4 --- squid/lib/rfc1123.c:1.6.6.3 Sun Jan 22 19:16:18 2006 +++ squid/lib/rfc1123.c Sun Jan 29 11:42:00 2006 @@ -230,6 +230,7 @@ #elif defined(_SQUID_AIX_) #elif defined(_SQUID_CYGWIN_) #elif defined(_SQUID_SGI_) +#elif defined(_SQUID_MSWIN_) #else extern long timezone; #endif @@ -239,7 +240,7 @@ */ if (tm->tm_isdst > 0) dst = -3600; -#if defined ( _timezone) || defined(_SQUID_CYGWIN_) +#if defined ( _timezone) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) t -= (_timezone + dst); #else t -= (timezone + dst); Index: squid/lib/sspwin32.c diff -u /dev/null squid/lib/sspwin32.c:1.1.4.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/lib/sspwin32.c Sun Nov 30 03:44:38 2003 @@ -0,0 +1,500 @@ +/* + * (C) 2002 Guido Serassio + * Based on previous work of Francesco Chemolli, Robert Collins + * + * Distributed freely under the terms of the GNU General Public License, + * version 2. See the file COPYING for licensing details + * + * 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 "ntlmauth.h" +#include "sspwin32.h" + +typedef struct _AUTH_SEQ { + BOOL fInitialized; + BOOL fHaveCredHandle; + BOOL fHaveCtxtHandle; + CredHandle hcred; + TimeStamp hcredLifeTime; + struct _SecHandle hctxt; + TimeStamp hctxtLifeTime; +} AUTH_SEQ, *PAUTH_SEQ; + +static HMODULE hModule; +static int NTLM_mode = SSP_BASIC; +SECURITY_STATUS SecurityStatus = SEC_E_OK; + +static DWORD cbMaxToken = 0; +static PVOID pClientBuf = NULL; +static PVOID pServerBuf = NULL; + +static AUTH_SEQ NTLM_asServer = {0}; + +BOOL Use_Unicode = FALSE; +BOOL NTLM_LocalCall = FALSE; + +/* Function pointers */ +ACCEPT_SECURITY_CONTEXT_FN _AcceptSecurityContext = NULL; +ACQUIRE_CREDENTIALS_HANDLE_FN _AcquireCredentialsHandle = NULL; +COMPLETE_AUTH_TOKEN_FN _CompleteAuthToken = NULL; +DELETE_SECURITY_CONTEXT_FN _DeleteSecurityContext = NULL; +FREE_CONTEXT_BUFFER_FN _FreeContextBuffer = NULL; +FREE_CREDENTIALS_HANDLE_FN _FreeCredentialsHandle = NULL; +INITIALIZE_SECURITY_CONTEXT_FN _InitializeSecurityContext = NULL; +QUERY_SECURITY_PACKAGE_INFO_FN _QuerySecurityPackageInfo = NULL; +#ifdef UNICODE +QUERY_CONTEXT_ATTRIBUTES_FN_W _QueryContextAttributes = NULL; +#else +QUERY_CONTEXT_ATTRIBUTES_FN_A _QueryContextAttributes = NULL; +#endif + +void UnloadSecurityDll(void) +{ + if (NTLM_asServer.fHaveCtxtHandle) + _DeleteSecurityContext(&NTLM_asServer.hctxt); + if (NTLM_asServer.fHaveCredHandle) + _FreeCredentialsHandle(&NTLM_asServer.hcred); + + if (hModule) + FreeLibrary(hModule); + + xfree(pClientBuf); + xfree(pServerBuf); + + _AcceptSecurityContext = NULL; + _AcquireCredentialsHandle = NULL; + _CompleteAuthToken = NULL; + _DeleteSecurityContext = NULL; + _FreeContextBuffer = NULL; + _FreeCredentialsHandle = NULL; + _InitializeSecurityContext = NULL; + _QuerySecurityPackageInfo = NULL; + _QueryContextAttributes = NULL; + + hModule = NULL; +} + + +HMODULE LoadSecurityDll(int mode) +{ + TCHAR lpszDLL[MAX_PATH]; + OSVERSIONINFO VerInfo; + PSecPkgInfo pSPI = NULL; + + /* + * Find out which security DLL to use, depending on + * whether we are on NT or 2000 or XP or 2003 Server + * We have to use security.dll on Windows NT 4.0. + * All other operating systems, we have to use Secur32.dll + */ + hModule = NULL; + if ((mode != SSP_BASIC) && (mode != SSP_NTLM)) + return hModule; + NTLM_mode = mode; + VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (!GetVersionEx (&VerInfo)) { /* If this fails, something has gone wrong */ + return hModule; + } + if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && + VerInfo.dwMajorVersion == 4 && + VerInfo.dwMinorVersion == 0) + { + lstrcpy (lpszDLL, _T(WINNT_SECURITY_DLL)); + } else { + lstrcpy (lpszDLL, _T(WIN2K_SECURITY_DLL)); + } + hModule = LoadLibrary(lpszDLL); + if (!hModule) + return hModule; + _AcceptSecurityContext = (ACCEPT_SECURITY_CONTEXT_FN) + GetProcAddress(hModule, "AcceptSecurityContext"); + if (!_AcceptSecurityContext) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } +#ifdef UNICODE + _AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN) + GetProcAddress(hModule, "AcquireCredentialsHandleW"); +#else + _AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN) + GetProcAddress(hModule, "AcquireCredentialsHandleA"); +#endif + if (!_AcquireCredentialsHandle) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } + _CompleteAuthToken = (COMPLETE_AUTH_TOKEN_FN) + GetProcAddress(hModule, "CompleteAuthToken"); + if (!_CompleteAuthToken) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } + _DeleteSecurityContext = (DELETE_SECURITY_CONTEXT_FN) + GetProcAddress(hModule, "DeleteSecurityContext"); + if (!_DeleteSecurityContext) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } + _FreeContextBuffer = (FREE_CONTEXT_BUFFER_FN) + GetProcAddress(hModule, "FreeContextBuffer"); + if (!_FreeContextBuffer) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } + _FreeCredentialsHandle = (FREE_CREDENTIALS_HANDLE_FN) + GetProcAddress(hModule, "FreeCredentialsHandle"); + if (!_FreeCredentialsHandle) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } +#ifdef UNICODE + _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) + GetProcAddress(hModule, "InitializeSecurityContextW"); +#else + _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) + GetProcAddress(hModule, "InitializeSecurityContextA"); +#endif + if (!_InitializeSecurityContext) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; + } +#ifdef UNICODE + _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN) + GetProcAddress(hModule, "QuerySecurityPackageInfoW"); +#else + _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN) + GetProcAddress(hModule, "QuerySecurityPackageInfoA"); +#endif + if (!_QuerySecurityPackageInfo) { + UnloadSecurityDll(); + hModule = NULL; + } + +#ifdef UNICODE + _QueryContextAttributes = (QUERY_CONTEXT_ATTRIBUTES_FN_W) + GetProcAddress(hModule, "QueryContextAttributesW"); +#else + _QueryContextAttributes = (QUERY_CONTEXT_ATTRIBUTES_FN_A) + GetProcAddress(hModule, "QueryContextAttributesA"); +#endif + if (!_QueryContextAttributes) { + UnloadSecurityDll(); + hModule = NULL; + } + + /* Get max token size */ + _QuerySecurityPackageInfo(_T("NTLM"), &pSPI); + cbMaxToken = pSPI->cbMaxToken; + _FreeContextBuffer(pSPI); + + /* Allocate buffers for client and server messages */ + pClientBuf = xcalloc(cbMaxToken, sizeof(char)); + pServerBuf = xcalloc(cbMaxToken, sizeof(char)); + + return hModule; +} + + +BOOL GenClientContext(PAUTH_SEQ pAS, PSEC_WINNT_AUTH_IDENTITY pAuthIdentity, + PVOID pIn, DWORD cbIn, PVOID pOut, PDWORD pcbOut, PBOOL pfDone) +{ +/* + * Routine Description: + * + * Optionally takes an input buffer coming from the server and returns + * a buffer of information to send back to the server. Also returns + * an indication of whether or not the context is complete. + * + * Return Value: + * Returns TRUE if successful; otherwise FALSE. + */ + TimeStamp tsExpiry; + SecBufferDesc sbdOut; + SecBuffer sbOut; + SecBufferDesc sbdIn; + SecBuffer sbIn; + ULONG fContextAttr; + + if (!pAS->fInitialized) { + SecurityStatus = _AcquireCredentialsHandle(NULL, _T(NTLM_PACKAGE_NAME), + SECPKG_CRED_OUTBOUND, NULL, (NTLM_mode == SSP_NTLM) ? NULL : pAuthIdentity, NULL, NULL, + &pAS->hcred, &tsExpiry); + if (SecurityStatus < 0) + return FALSE; + pAS->fHaveCredHandle = TRUE; + } + + /* Prepare output buffer */ + sbdOut.ulVersion = 0; + sbdOut.cBuffers = 1; + sbdOut.pBuffers = &sbOut; + sbOut.cbBuffer = *pcbOut; + sbOut.BufferType = SECBUFFER_TOKEN; + sbOut.pvBuffer = pOut; + + /* Prepare input buffer */ + if (pAS->fInitialized) { + sbdIn.ulVersion = 0; + sbdIn.cBuffers = 1; + sbdIn.pBuffers = &sbIn; + sbIn.cbBuffer = cbIn; + sbIn.BufferType = SECBUFFER_TOKEN; + sbIn.pvBuffer = pIn; + } + SecurityStatus = _InitializeSecurityContext(&pAS->hcred, + pAS->fInitialized ? &pAS->hctxt : NULL, NULL, 0, 0, + SECURITY_NATIVE_DREP, pAS->fInitialized ? &sbdIn : NULL, + 0, &pAS->hctxt, &sbdOut, &fContextAttr, &tsExpiry); + if (SecurityStatus < 0) + return FALSE; + pAS->fHaveCtxtHandle = TRUE; + + /* If necessary, complete token */ + if (SecurityStatus == SEC_I_COMPLETE_NEEDED || SecurityStatus == SEC_I_COMPLETE_AND_CONTINUE) { + SecurityStatus = _CompleteAuthToken(&pAS->hctxt, &sbdOut); + if (SecurityStatus < 0) + return FALSE; + } + *pcbOut = sbOut.cbBuffer; + if (!pAS->fInitialized) + pAS->fInitialized = TRUE; + *pfDone = !(SecurityStatus == SEC_I_CONTINUE_NEEDED + || SecurityStatus == SEC_I_COMPLETE_AND_CONTINUE ); + return TRUE; +} + + +BOOL GenServerContext(PAUTH_SEQ pAS, PVOID pIn, DWORD cbIn, PVOID pOut, + PDWORD pcbOut, PBOOL pfDone, char * credentials) +{ +/* + * Routine Description: + * + * Takes an input buffer coming from the client and returns a buffer + * to be sent to the client. Also returns an indication of whether or + * not the context is complete. + * + * Return Value: + * + * Returns TRUE if successful; otherwise FALSE. + */ + + SecBufferDesc sbdOut; + SecBuffer sbOut; + SecBufferDesc sbdIn; + SecBuffer sbIn; + ULONG fContextAttr; + SecPkgContext_Names namebuffer; + + if (!pAS->fInitialized) { + SecurityStatus = _AcquireCredentialsHandle(NULL, _T("NTLM"), + SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &pAS->hcred, + &pAS->hcredLifeTime); + if (SecurityStatus < 0) + return FALSE; + pAS->fHaveCredHandle = TRUE; + } + + /* Prepare output buffer */ + sbdOut.ulVersion = 0; + sbdOut.cBuffers = 1; + sbdOut.pBuffers = &sbOut; + sbOut.cbBuffer = *pcbOut; + sbOut.BufferType = SECBUFFER_TOKEN; + sbOut.pvBuffer = pOut; + + /* Prepare input buffer */ + sbdIn.ulVersion = 0; + sbdIn.cBuffers = 1; + sbdIn.pBuffers = &sbIn; + sbIn.cbBuffer = cbIn; + sbIn.BufferType = SECBUFFER_TOKEN; + sbIn.pvBuffer = pIn; + SecurityStatus = _AcceptSecurityContext(&pAS->hcred, + pAS->fInitialized ? &pAS->hctxt : NULL, &sbdIn, (NTLM_mode == SSP_NTLM) ? ASC_REQ_DELEGATE : 0, + SECURITY_NATIVE_DREP, &pAS->hctxt, &sbdOut, &fContextAttr, + &pAS->hctxtLifeTime); + if (SecurityStatus < 0) + return FALSE; + pAS->fHaveCtxtHandle = TRUE; + + /* If necessary, complete token */ + if (SecurityStatus == SEC_I_COMPLETE_NEEDED || SecurityStatus == SEC_I_COMPLETE_AND_CONTINUE) { + SecurityStatus = _CompleteAuthToken(&pAS->hctxt, &sbdOut); + if (SecurityStatus < 0) + return FALSE; + } + + if (credentials != NULL) { + SecurityStatus = _QueryContextAttributes(&pAS->hctxt, SECPKG_ATTR_NAMES, &namebuffer); + if (SecurityStatus < 0) + return FALSE; + strcpy(credentials, namebuffer.sUserName); + } + + *pcbOut = sbOut.cbBuffer; + if (!pAS->fInitialized) + pAS->fInitialized = TRUE; + *pfDone = !(SecurityStatus = SEC_I_CONTINUE_NEEDED + || SecurityStatus == SEC_I_COMPLETE_AND_CONTINUE); + return TRUE; +} + + +BOOL WINAPI SSP_LogonUser(PTSTR szUser, PTSTR szPassword, PTSTR szDomain) +{ + AUTH_SEQ asServer = {0}; + AUTH_SEQ asClient = {0}; + BOOL fDone = FALSE; + BOOL fResult = FALSE; + DWORD cbOut = 0; + DWORD cbIn = 0; + + SEC_WINNT_AUTH_IDENTITY ai; + + do { + if (!hModule) + break; + + /* Initialize auth identity structure */ + ZeroMemory(&ai, sizeof(ai)); + ai.Domain = szDomain; + ai.DomainLength = lstrlen(szDomain); + ai.User = szUser; + ai.UserLength = lstrlen(szUser); + ai.Password = szPassword; + ai.PasswordLength = lstrlen(szPassword); +#if defined(UNICODE) || defined(_UNICODE) + ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; +#else + ai.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; +#endif + + /* Prepare client message (negotiate) */ + cbOut = cbMaxToken; + if (!GenClientContext(&asClient, &ai, NULL, 0, pClientBuf, &cbOut, &fDone)) + break; + + /* Prepare server message (challenge) */ + cbIn = cbOut; + cbOut = cbMaxToken; + if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, + &fDone, NULL)) + break; +/* Most likely failure: AcceptServerContext fails with SEC_E_LOGON_DENIED + * in the case of bad szUser or szPassword. + * Unexpected Result: Logon will succeed if you pass in a bad szUser and + * the guest account is enabled in the specified domain. + */ + + /* Prepare client message (authenticate) */ + cbIn = cbOut; + cbOut = cbMaxToken; + if (!GenClientContext(&asClient, &ai, pServerBuf, cbIn, pClientBuf, &cbOut, + &fDone)) + break; + + /* Prepare server message (authentication) */ + cbIn = cbOut; + cbOut = cbMaxToken; + if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, + &fDone, NULL)) + break; + fResult = TRUE; + } while(0); + + /* Clean up resources */ + if (asClient.fHaveCtxtHandle) + _DeleteSecurityContext(&asClient.hctxt); + if (asClient.fHaveCredHandle) + _FreeCredentialsHandle(&asClient.hcred); + if (asServer.fHaveCtxtHandle) + _DeleteSecurityContext(&asServer.hctxt); + if (asServer.fHaveCredHandle) + _FreeCredentialsHandle(&asServer.hcred); + + return fResult; +} + + +const char * WINAPI SSP_MakeChallenge(PVOID PNegotiateBuf, int NegotiateLen) +{ + BOOL fDone = FALSE; + PVOID fResult = NULL; + DWORD cbOut = 0; + DWORD cbIn = 0; + ntlm_challenge * challenge; + const char * encoded = NULL; + + if (NTLM_asServer.fHaveCtxtHandle) + _DeleteSecurityContext(&NTLM_asServer.hctxt); + if (NTLM_asServer.fHaveCredHandle) + _FreeCredentialsHandle(&NTLM_asServer.hcred); + + NTLM_LocalCall = FALSE; + Use_Unicode = FALSE; + memcpy(pClientBuf, PNegotiateBuf, NegotiateLen); + ZeroMemory(pServerBuf, cbMaxToken); + ZeroMemory(&NTLM_asServer, sizeof(NTLM_asServer)); + do { + if (!hModule) + break; + + /* Prepare server message (challenge) */ + cbIn = NegotiateLen; + cbOut = cbMaxToken; + if (!GenServerContext(&NTLM_asServer, pClientBuf, cbIn, pServerBuf, &cbOut, + &fDone, NULL)) + break; + fResult = pServerBuf; + } while(0); + if (fResult != NULL) { + challenge = (ntlm_challenge *) fResult; + Use_Unicode = NEGOTIATE_UNICODE & challenge->flags; + NTLM_LocalCall = NEGOTIATE_THIS_IS_LOCAL_CALL & challenge->flags; + encoded = base64_encode_bin((char *) fResult, cbOut); + } + return encoded; +} + + +BOOL WINAPI SSP_ValidateCredentials(PVOID PAutenticateBuf, int AutenticateLen, char * credentials) +{ + BOOL fDone = FALSE; + BOOL fResult = FALSE; + DWORD cbOut = 0; + DWORD cbIn = 0; + + memcpy(pClientBuf, PAutenticateBuf, AutenticateLen); + ZeroMemory(pServerBuf, cbMaxToken); + do { + if (!hModule) + break; + + /* Prepare server message (authentication) */ + cbIn = AutenticateLen; + cbOut = cbMaxToken; + if (!GenServerContext(&NTLM_asServer, pClientBuf, cbIn, pServerBuf, &cbOut, + &fDone, credentials)) + break; + fResult = TRUE; + } while(0); + + return fResult; +} Index: squid/lib/util.c diff -u squid/lib/util.c:1.12.6.3 squid/lib/util.c:1.12.14.7 --- squid/lib/util.c:1.12.6.3 Thu Jun 30 19:17:21 2005 +++ squid/lib/util.c Sat Jul 2 02:58:57 2005 @@ -33,6 +33,8 @@ * */ +#ifndef UTIL_C +#define UTIL_C #define _etext etext #include "config.h" @@ -739,3 +741,4 @@ write(2, "\n", 1); abort(); } +#endif /* UTIL_C */ Index: squid/lib/win32lib.c diff -u /dev/null squid/lib/win32lib.c:1.1.32.21 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/lib/win32lib.c Sun Oct 30 01:24:43 2005 @@ -0,0 +1,638 @@ +/* + * $Id$ + * + * * * * * * * * Legal stuff * * * * * * * + * + * (C) 2001 Guido Serassio , + * inspired by previous work by Romeo Anghelache & Eric Stern. + * + * 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" + +/* The following code section is part of an EXPERIMENTAL native */ +/* Windows NT/2000 Squid port - Compiles only on MS Visual C++ */ +#if defined(_SQUID_MSWIN_) + +#undef strerror +#define sys_nerr _sys_nerr + +#undef assert +#include +#include +#include +#include +#include +#if HAVE_WIN32_PSAPI +#include +#endif + +THREADLOCAL int ws32_result; +THREADLOCAL int _so_err; +THREADLOCAL int _so_err_siz = sizeof(int); +LPCRITICAL_SECTION dbg_mutex = NULL; + +/* internal to Microsoft CRTLIB */ +#define FPIPE 0x08 /* file handle refers to a pipe */ +typedef struct { + long osfhnd; /* underlying OS file HANDLE */ + char osfile; /* attributes of file (e.g., open in text mode?) */ + char pipech; /* one char buffer for handles opened on pipes */ +#ifdef _MT + int lockinitflag; + CRITICAL_SECTION lock; +#endif /* _MT */ + } ioinfo; +#define IOINFO_L2E 5 +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) +#define _pioinfo(i) ( __pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)) ) +#define _osfile(i) ( _pioinfo(i)->osfile ) +#define _osfhnd(i) ( _pioinfo(i)->osfhnd ) + +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ + +extern _CRTIMP ioinfo * __pioinfo[]; +int __cdecl _free_osfhnd(int); +#define FOPEN 0x01 /* file handle open */ + +#elif defined(__MINGW32__) /* MinGW environment */ + +#define FOPEN 0x01 /* file handle open */ +__MINGW_IMPORT ioinfo * __pioinfo[]; +int _free_osfhnd(int); + +#endif + + +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +size_t getpagesize() +{ + return 4096; +} + +int64_t WIN32_strtoll(const char *nptr, char **endptr, int base) +{ + const char *s; + int64_t acc; + int64_t val; + int neg, any; + char c; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) { + errno = EINVAL; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return acc; + } + + /* The classic bsd implementation requires div/mod operators + * to compute a cutoff. Benchmarking proves that is very, very + * evil to some 32 bit processors. Instead, look for underflow + * in both the mult and add/sub operation. Unlike the bsd impl, + * we also work strictly in a signed int64 word as we haven't + * implemented the unsigned type in win32. + * + * Set 'any' if any `digits' consumed; make it negative to indicate + * overflow. + */ + val = 0; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + val *= base; + if ( (any < 0) /* already noted an over/under flow - short circuit */ + || (neg && (val > acc || (val -= c) > acc)) /* underflow */ + || (!neg && (val < acc || (val += c) < acc))) { /* overflow */ + any = -1; /* once noted, over/underflows never go away */ + } else { + acc = val; + any = 1; + } + } + + if (any < 0) { + acc = neg ? INT64_MIN : INT64_MAX; + errno = ERANGE; + } else if (!any) { + errno = EINVAL; + } + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} +#endif + +uid_t geteuid(void) +{ + return 100; +} + +uid_t getuid(void) +{ + return 100; +} + +int setuid(uid_t uid) +{ + return 0; +} + +int seteuid(uid_t euid) +{ + return 0; +} + +gid_t getegid(void) +{ + return 100; +} + +gid_t getgid(void) +{ + return 100; +} + +int setgid(gid_t gid) +{ + return 0; +} + +int setegid(gid_t egid) +{ + return 0; +} + +int chroot(const char *dirname) +{ + if (SetCurrentDirectory(dirname)) + return 0; + else + return GetLastError(); +} + +void GetProcessName(pid_t pid, char * ProcessName) +{ + HANDLE hProcess; + + strcpy(ProcessName, "unknown"); +#if HAVE_WIN32_PSAPI + /* Get a handle to the process. */ + hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | + PROCESS_VM_READ, + FALSE, pid ); + /* Get the process name. */ + if (NULL != hProcess) { + HMODULE hMod; + DWORD cbNeeded; + + if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) + GetModuleBaseName(hProcess, hMod, ProcessName, sizeof(ProcessName)); + else { + CloseHandle(hProcess); + return; + } + } else + return; + CloseHandle(hProcess); +#endif +} + +int kill(pid_t pid, int sig) +{ + HANDLE hProcess; + char MyProcessName[MAX_PATH]; + char ProcessNameToCheck[MAX_PATH]; + + if (sig == 0) { + if ((hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | + PROCESS_VM_READ, + FALSE, pid)) == NULL) + return -1; + else { + CloseHandle(hProcess); + GetProcessName(getpid(), MyProcessName); + GetProcessName(pid, ProcessNameToCheck); + if (strcmp(MyProcessName, ProcessNameToCheck) == 0) + return 0; + return -1; + } + } + else return 0; +} + +int gettimeofday( struct timeval * pcur_time, struct timezone * tz) +{ + + struct _timeb current; + + _ftime(¤t); + + pcur_time->tv_sec=current.time; + pcur_time->tv_usec=current.millitm * 1000L; + if (tz) + { + tz->tz_minuteswest = current.timezone; /* minutes west of Greenwich */ + tz->tz_dsttime = current.dstflag; /* type of dst correction */ + } + + return 0; +} + +int statfs(const char *path, struct statfs *sfs) +{ + char drive[4]; + DWORD spc, bps, freec, totalc; + DWORD vsn, maxlen, flags; + + if (!sfs) + { + errno=EINVAL; + return -1; + } + + strncpy(drive,path,2); + drive[2]='\0'; + strcat(drive,"\\"); + + if (!GetDiskFreeSpace(drive, &spc, &bps, &freec, &totalc)) { + errno=ENOENT; + return -1; + } + if (!GetVolumeInformation(drive, NULL, 0, &vsn, &maxlen, &flags, NULL, 0)) + { + errno=ENOENT; + return -1; + } + sfs->f_type = flags; + sfs->f_bsize = spc*bps; + sfs->f_blocks = totalc; + sfs->f_bfree = sfs->f_bavail = freec; + sfs->f_files = -1; + sfs->f_ffree = -1; + sfs->f_fsid = vsn; + sfs->f_namelen = maxlen; + return 0; +} + +#if USE_TRUNCATE +int +WIN32_ftruncate (int fd, off_t size) +{ + HANDLE file; + DWORD error; + LARGE_INTEGER size64; + LARGE_INTEGER test64; + + if (fd < 0) { + errno = EBADF; + return -1; + } + + size64.QuadPart = (__int64)size; + test64.QuadPart = 0; + + file = (HANDLE)_get_osfhandle(fd); + + /* Get current file position to check File Handle */ + test64.LowPart = SetFilePointer(file, test64.LowPart, &test64.HighPart, FILE_CURRENT); + if ((test64.LowPart == INVALID_SET_FILE_POINTER) && ((error = GetLastError()) != NO_ERROR)) + goto WIN32_ftruncate_error; + + /* Set the current File Pointer position */ + size64.LowPart = SetFilePointer(file, size64.LowPart, &size64.HighPart, FILE_BEGIN); + if ((size64.LowPart == INVALID_SET_FILE_POINTER) && ((error = GetLastError()) != NO_ERROR)) + goto WIN32_ftruncate_error; + else if (!SetEndOfFile(file)) { + int error = GetLastError (); + goto WIN32_ftruncate_error; + } + return 0; + +WIN32_ftruncate_error: + switch (error) + { + case ERROR_INVALID_HANDLE: + errno = EBADF; + break; + default: + errno = EIO; + break; + } + + return -1; +} + +int WIN32_truncate (const char *pathname, off_t length) +{ + int fd; + int res = -1; + + fd = open(pathname, O_RDWR); + + if (fd == -1) + errno = EBADF; + else { + res = WIN32_ftruncate(fd, length); + _close(fd); + } + + return res; +} +#endif + +static struct _wsaerrtext { + int err; + const char *errconst; + const char *errdesc; +} _wsaerrtext[] = { + {WSA_E_CANCELLED, "WSA_E_CANCELLED", "Lookup cancelled."}, + {WSA_E_NO_MORE, "WSA_E_NO_MORE", "No more data available."}, + {WSAEACCES, "WSAEACCES", "Permission denied."}, + {WSAEADDRINUSE, "WSAEADDRINUSE", "Address already in use."}, + {WSAEADDRNOTAVAIL, "WSAEADDRNOTAVAIL", "Cannot assign requested address."}, + {WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT", "Address family not supported by protocol family."}, + {WSAEALREADY, "WSAEALREADY", "Operation already in progress."}, + {WSAEBADF, "WSAEBADF", "Bad file number."}, + {WSAECANCELLED, "WSAECANCELLED", "Operation cancelled."}, + {WSAECONNABORTED, "WSAECONNABORTED", "Software caused connection abort."}, + {WSAECONNREFUSED, "WSAECONNREFUSED", "Connection refused."}, + {WSAECONNRESET, "WSAECONNRESET", "Connection reset by peer."}, + {WSAEDESTADDRREQ, "WSAEDESTADDRREQ", "Destination address required."}, + {WSAEDQUOT, "WSAEDQUOT", "Disk quota exceeded."}, + {WSAEFAULT, "WSAEFAULT", "Bad address."}, + {WSAEHOSTDOWN, "WSAEHOSTDOWN", "Host is down."}, + {WSAEHOSTUNREACH, "WSAEHOSTUNREACH", "No route to host."}, + {WSAEINPROGRESS, "WSAEINPROGRESS", "Operation now in progress."}, + {WSAEINTR, "WSAEINTR", "Interrupted function call."}, + {WSAEINVAL, "WSAEINVAL", "Invalid argument."}, + {WSAEINVALIDPROCTABLE, "WSAEINVALIDPROCTABLE", "Invalid procedure table from service provider."}, + {WSAEINVALIDPROVIDER, "WSAEINVALIDPROVIDER", "Invalid service provider version number."}, + {WSAEISCONN, "WSAEISCONN", "Socket is already connected."}, + {WSAELOOP, "WSAELOOP", "Too many levels of symbolic links."}, + {WSAEMFILE, "WSAEMFILE", "Too many open files."}, + {WSAEMSGSIZE, "WSAEMSGSIZE", "Message too long."}, + {WSAENAMETOOLONG, "WSAENAMETOOLONG", "File name is too long."}, + {WSAENETDOWN, "WSAENETDOWN", "Network is down."}, + {WSAENETRESET, "WSAENETRESET", "Network dropped connection on reset."}, + {WSAENETUNREACH, "WSAENETUNREACH", "Network is unreachable."}, + {WSAENOBUFS, "WSAENOBUFS", "No buffer space available."}, + {WSAENOMORE, "WSAENOMORE", "No more data available."}, + {WSAENOPROTOOPT, "WSAENOPROTOOPT", "Bad protocol option."}, + {WSAENOTCONN, "WSAENOTCONN", "Socket is not connected."}, + {WSAENOTEMPTY, "WSAENOTEMPTY", "Directory is not empty."}, + {WSAENOTSOCK, "WSAENOTSOCK", "Socket operation on nonsocket."}, + {WSAEOPNOTSUPP, "WSAEOPNOTSUPP", "Operation not supported."}, + {WSAEPFNOSUPPORT, "WSAEPFNOSUPPORT", "Protocol family not supported."}, + {WSAEPROCLIM, "WSAEPROCLIM", "Too many processes."}, + {WSAEPROTONOSUPPORT, "WSAEPROTONOSUPPORT", "Protocol not supported."}, + {WSAEPROTOTYPE, "WSAEPROTOTYPE", "Protocol wrong type for socket."}, + {WSAEPROVIDERFAILEDINIT, "WSAEPROVIDERFAILEDINIT", "Unable to initialise a service provider."}, + {WSAEREFUSED, "WSAEREFUSED", "Refused."}, + {WSAEREMOTE, "WSAEREMOTE", "Too many levels of remote in path."}, + {WSAESHUTDOWN, "WSAESHUTDOWN", "Cannot send after socket shutdown."}, + {WSAESOCKTNOSUPPORT, "WSAESOCKTNOSUPPORT", "Socket type not supported."}, + {WSAESTALE, "WSAESTALE", "Stale NFS file handle."}, + {WSAETIMEDOUT, "WSAETIMEDOUT", "Connection timed out."}, + {WSAETOOMANYREFS, "WSAETOOMANYREFS", "Too many references."}, + {WSAEUSERS, "WSAEUSERS", "Too many users."}, + {WSAEWOULDBLOCK, "WSAEWOULDBLOCK", "Resource temporarily unavailable."}, + {WSANOTINITIALISED, "WSANOTINITIALISED", "Successful WSAStartup not yet performed."}, + {WSASERVICE_NOT_FOUND, "WSASERVICE_NOT_FOUND", "Service not found."}, + {WSASYSCALLFAILURE, "WSASYSCALLFAILURE", "System call failure."}, + {WSASYSNOTREADY, "WSASYSNOTREADY", "Network subsystem is unavailable."}, + {WSATYPE_NOT_FOUND, "WSATYPE_NOT_FOUND", "Class type not found."}, + {WSAVERNOTSUPPORTED, "WSAVERNOTSUPPORTED", "Winsock.dll version out of range."}, + {WSAEDISCON, "WSAEDISCON", "Graceful shutdown in progress."} +}; + +/* + * wsastrerror() - description of WSAGetLastError() + */ +const char * +wsastrerror(int err) +{ + static char xwsaerror_buf[BUFSIZ]; + int i, errind = -1; + + if (err == 0) + return "(0) No error."; + for (i = 0; i < sizeof(_wsaerrtext)/sizeof(struct _wsaerrtext); i++) { + if (_wsaerrtext[i].err != err) + continue; + errind = i; + break; + } + if (errind == -1) + snprintf(xwsaerror_buf, BUFSIZ, "Unknown"); + else + snprintf(xwsaerror_buf, BUFSIZ, "%s, %s", _wsaerrtext[errind].errconst, _wsaerrtext[errind].errdesc); + return xwsaerror_buf; +} + +struct passwd *getpwnam(char * unused) +{ + static struct passwd pwd = {NULL, NULL, 100, 100, NULL, NULL, NULL}; + return &pwd; +} + +struct group *getgrnam(char * unused) +{ + static struct group grp = {NULL, NULL, 100, NULL}; + return &grp; +} + +/* + * WIN32_strerror with argument for late notification */ + +const char * +WIN32_strerror(int err) +{ + static char xbstrerror_buf[BUFSIZ]; + + if (err < 0 || err >= sys_nerr) + strncpy(xbstrerror_buf, wsastrerror(err), BUFSIZ); + else + strncpy(xbstrerror_buf, strerror(err), BUFSIZ); + return xbstrerror_buf; +} + +int WIN32_Close_FD_Socket(int fd) + +{ + int result = 0; + + if (closesocket(_get_osfhandle(fd)) == SOCKET_ERROR) { + errno = WSAGetLastError(); + result = 1; + } + _free_osfhnd(fd); + _osfile(fd) = 0; + return result; +} + +#if defined(__MINGW32__) /* MinGW environment */ +int _free_osfhnd(int filehandle) +{ + if ( ((unsigned)filehandle < SQUID_MAXFD) && + (_osfile(filehandle) & FOPEN) && + (_osfhnd(filehandle) != (long)INVALID_HANDLE_VALUE) ) + { + switch (filehandle) { + case 0: + SetStdHandle( STD_INPUT_HANDLE, NULL ); + break; + case 1: + SetStdHandle( STD_OUTPUT_HANDLE, NULL ); + break; + case 2: + SetStdHandle( STD_ERROR_HANDLE, NULL ); + break; + } + _osfhnd(filehandle) = (long)INVALID_HANDLE_VALUE; + return(0); + } else { + errno = EBADF; /* bad handle */ + _doserrno = 0L; /* not an OS error */ + return -1; + } +} +#endif + +struct errorentry { + unsigned long WIN32_code; + int POSIX_errno; +}; + +static struct errorentry errortable[] = { + {ERROR_INVALID_FUNCTION, EINVAL}, + {ERROR_FILE_NOT_FOUND, ENOENT}, + {ERROR_PATH_NOT_FOUND, ENOENT}, + {ERROR_TOO_MANY_OPEN_FILES, EMFILE}, + {ERROR_ACCESS_DENIED, EACCES}, + {ERROR_INVALID_HANDLE, EBADF}, + {ERROR_ARENA_TRASHED, ENOMEM}, + {ERROR_NOT_ENOUGH_MEMORY, ENOMEM}, + {ERROR_INVALID_BLOCK, ENOMEM}, + {ERROR_BAD_ENVIRONMENT, E2BIG}, + {ERROR_BAD_FORMAT, ENOEXEC}, + {ERROR_INVALID_ACCESS, EINVAL}, + {ERROR_INVALID_DATA, EINVAL}, + {ERROR_INVALID_DRIVE, ENOENT}, + {ERROR_CURRENT_DIRECTORY, EACCES}, + {ERROR_NOT_SAME_DEVICE, EXDEV}, + {ERROR_NO_MORE_FILES, ENOENT}, + {ERROR_LOCK_VIOLATION, EACCES}, + {ERROR_BAD_NETPATH, ENOENT}, + {ERROR_NETWORK_ACCESS_DENIED, EACCES}, + {ERROR_BAD_NET_NAME, ENOENT}, + {ERROR_FILE_EXISTS, EEXIST}, + {ERROR_CANNOT_MAKE, EACCES}, + {ERROR_FAIL_I24, EACCES}, + {ERROR_INVALID_PARAMETER, EINVAL}, + {ERROR_NO_PROC_SLOTS, EAGAIN}, + {ERROR_DRIVE_LOCKED, EACCES}, + {ERROR_BROKEN_PIPE, EPIPE}, + {ERROR_DISK_FULL, ENOSPC}, + {ERROR_INVALID_TARGET_HANDLE, EBADF}, + {ERROR_INVALID_HANDLE, EINVAL}, + {ERROR_WAIT_NO_CHILDREN, ECHILD}, + {ERROR_CHILD_NOT_COMPLETE, ECHILD}, + {ERROR_DIRECT_ACCESS_HANDLE, EBADF}, + {ERROR_NEGATIVE_SEEK, EINVAL}, + {ERROR_SEEK_ON_DEVICE, EACCES}, + {ERROR_DIR_NOT_EMPTY, ENOTEMPTY }, + {ERROR_NOT_LOCKED, EACCES}, + {ERROR_BAD_PATHNAME, ENOENT}, + {ERROR_MAX_THRDS_REACHED, EAGAIN}, + {ERROR_LOCK_FAILED, EACCES}, + {ERROR_ALREADY_EXISTS, EEXIST}, + {ERROR_FILENAME_EXCED_RANGE, ENOENT}, + {ERROR_NESTING_NOT_ALLOWED, EAGAIN}, + {ERROR_NOT_ENOUGH_QUOTA, ENOMEM} +}; + +#define MIN_EXEC_ERROR ERROR_INVALID_STARTING_CODESEG +#define MAX_EXEC_ERROR ERROR_INFLOOP_IN_RELOC_CHAIN + +#define MIN_EACCES_RANGE ERROR_WRITE_PROTECT +#define MAX_EACCES_RANGE ERROR_SHARING_BUFFER_EXCEEDED + +void WIN32_maperror(unsigned long WIN32_oserrno) +{ + int i; + + _doserrno = WIN32_oserrno; + for (i = 0; i < (sizeof(errortable)/sizeof(struct errorentry)); ++i) { + if (WIN32_oserrno == errortable[i].WIN32_code) { + errno = errortable[i].POSIX_errno; + return; + } + } + if (WIN32_oserrno >= MIN_EACCES_RANGE && WIN32_oserrno <= MAX_EACCES_RANGE) + errno = EACCES; + else if (WIN32_oserrno >= MIN_EXEC_ERROR && WIN32_oserrno <= MAX_EXEC_ERROR) + errno = ENOEXEC; + else + errno = EINVAL; +} +#endif Index: squid/port/.cvsignore diff -u /dev/null squid/port/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/.cvsignore Sun Nov 10 08:02:10 2002 @@ -0,0 +1,2 @@ +.cvsignore +Makefile.in Index: squid/port/Makefile.am diff -u /dev/null squid/port/Makefile.am:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/Makefile.am Sun Nov 10 08:02:10 2002 @@ -0,0 +1,6 @@ +## Process this file with automake to produce Makefile.in +# +# $Id$ +# + +SUBDIRS = win32 Index: squid/port/win32/.cvsignore diff -u /dev/null squid/port/win32/.cvsignore:1.1.4.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/.cvsignore Sun Nov 10 08:02:11 2002 @@ -0,0 +1,4 @@ +.cvsignore +Debug +Release +Makefile.in Index: squid/port/win32/Build.dsp diff -u /dev/null squid/port/win32/Build.dsp:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/Build.dsp Sat Nov 27 03:37:32 2004 @@ -0,0 +1,63 @@ +# Microsoft Developer Studio Project File - Name="Build" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=Build - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Build.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Build.mak" CFG="Build - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Build - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "Build - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "Build - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "Build - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Build___Win32_Debug" +# PROP BASE Intermediate_Dir "Build___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "Build - Win32 Release" +# Name "Build - Win32 Debug" +# End Target +# End Project Index: squid/port/win32/Makefile.am diff -u /dev/null squid/port/win32/Makefile.am:1.1.2.8 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/Makefile.am Sun May 1 00:50:11 2005 @@ -0,0 +1,66 @@ +## Process this file with automake to produce Makefile.in +# +# $Id$ +# + +EXTRA_DIST = \ + auth_modules.cmd \ + Build.dsp \ + cf_data.dsp \ + default_config_file.cmd \ + doc.dsp \ + icons.cmd \ + icons.dsp \ + install.dsp \ + modules.dsp \ + PerlPreprocessing.dsp \ + repl_modules.cmd \ + squid.dsw \ + squid_conf_default.dsp \ + squid_mswin.mak \ + store_modules.cmd \ + update.cmd \ + cachemgr/cachemgr.dsp \ + cf_gen/cf_gen.dsp \ + dnsserver/dnsserver.dsp \ + fake_auth/fake_auth.dsp \ + include/autoconf.h \ + include/autoconf.h.ssl \ + include/cdefs.h \ + include/crypt.h \ + include/getopt.h \ + include/Readdir.h \ + include/squid-mswin.h \ + ip_user_check/ip_user_check.dsp \ + LDAP_auth/LDAP_auth.dsp \ + LDAP_group/LDAP_group.dsp \ + libawin32/libawin32.dsp \ + libbasic/libbasic.dsp \ + libdigest/libdigest.dsp \ + libgnuregex/libgnuregex.dsp \ + libheap/libheap.dsp \ + liblru/liblru.dsp \ + libmiscutil/libmiscutil.dsp \ + libntlm/libntlm.dsp \ + libntlmauth/libntlmauth.dsp \ + libnull/libnull.dsp \ + libsnmp/libsnmp.dsp \ + libsspwin32/libsspwin32.dsp \ + libufs/libufs.dsp \ + NCSA_auth/NCSA_auth.dsp \ + nt_auth/nt_auth.dsp \ + ntlm_win32_auth/ntlm_win32_auth.dsp \ + pinger/pinger.dsp \ + squid/buildcount.dsm \ + squid/buildver.h \ + squid/resource.h \ + squid/squid.dsp \ + squid/squid.mak \ + squid/squid.rc \ + squid/squid.rc2 \ + pinger/pinger.dsp \ + squidclient/squidclient.dsp \ + src/encrypt.c \ + src/readdir.c \ + unlinkd/unlinkd.dsp \ + win32_check_group/win32_check_group.dsp Index: squid/port/win32/PerlPreprocessing.dsp diff -u /dev/null squid/port/win32/PerlPreprocessing.dsp:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/PerlPreprocessing.dsp Wed Mar 27 13:01:10 2002 @@ -0,0 +1,129 @@ +# Microsoft Developer Studio Project File - Name="PerlPreprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=PerlPreprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "PerlPreprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "PerlPreprocessing.mak" CFG="PerlPreprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "PerlPreprocessing - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "PerlPreprocessing - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "PerlPreprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "PerlPreprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "PerlPreprocessing - Win32 Release" +# Name "PerlPreprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\src\enums.h + +!IF "$(CFG)" == "PerlPreprocessing - Win32 Release" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +InputPath=..\..\src\enums.h + +"$(InputDir)\string_arrays.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + perl $(InputDir)\mk-string-arrays.pl <$(InputPath) >$(InputDir)\string_arrays.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "PerlPreprocessing - Win32 Debug" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +InputPath=..\..\src\enums.h + +"$(InputDir)\string_arrays.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + perl $(InputDir)\mk-string-arrays.pl <$(InputPath) >$(InputDir)\string_arrays.c + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\src\globals.h + +!IF "$(CFG)" == "PerlPreprocessing - Win32 Release" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +InputPath=..\..\src\globals.h + +"$(InputDir)\globals.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + perl $(InputDir)\mk-globals-c.pl <$(InputPath) >$(InputDir)\globals.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "PerlPreprocessing - Win32 Debug" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +InputPath=..\..\src\globals.h + +"$(InputDir)\globals.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + perl $(InputDir)\mk-globals-c.pl <$(InputPath) >$(InputDir)\globals.c + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/auth_modules.cmd diff -u /dev/null squid/port/win32/auth_modules.cmd:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/auth_modules.cmd Wed Mar 27 13:01:10 2002 @@ -0,0 +1,16 @@ +@echo off +if exist %temp%\auth_modules.txt del %temp%\auth_modules.txt +:loop +echo %1 >> %temp%\auth_modules.txt +shift /1 +if NOT "%1"=="" goto :loop +echo /* automatically generated by %0 %* +echo * do not edit +echo */ +echo #include "squid.h" +for /F %%m in (%temp%\auth_modules.txt) do echo extern AUTHSSETUP authSchemeSetup_%%m; +echo void authSchemeSetup(void) +echo { +for /F %%m in (%temp%\auth_modules.txt) do echo authSchemeAdd("%%m", authSchemeSetup_%%m); +echo } +if exist %temp%\auth_modules.txt del %temp%\auth_modules.txt Index: squid/port/win32/cf_data.dsp diff -u /dev/null squid/port/win32/cf_data.dsp:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/cf_data.dsp Wed Mar 27 13:01:10 2002 @@ -0,0 +1,112 @@ +# Microsoft Developer Studio Project File - Name="cf_data" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=cf_data - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cf_data.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cf_data.mak" CFG="cf_data - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cf_data - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "cf_data - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "cf_data - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "cf_data - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "cf_data___Win32_Debug" +# PROP BASE Intermediate_Dir "cf_data___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "cf_data - Win32 Release" +# Name "cf_data - Win32 Debug" +# Begin Source File + +SOURCE=..\..\src\cf.data.pre + +!IF "$(CFG)" == "cf_data - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__CF_DA="squid_mswin.mak" +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +ProjDir=. +InputPath=..\..\src\cf.data.pre + +BuildCmds= \ + nmake /f $(ProjDir)\squid_mswin.mak cf.data \ + nmake /f $(ProjDir)\squid_mswin.mak cf_gen_defines.h \ + + +"$(InputDir)\cf.data" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\cf_gen_defines.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "cf_data - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__CF_DA="squid_mswin.mak" +# Begin Custom Build +InputDir=\WORK\CYGWIN-SVC-2_5\src +ProjDir=. +InputPath=..\..\src\cf.data.pre + +BuildCmds= \ + nmake /f $(ProjDir)\squid_mswin.mak cf.data \ + nmake /f $(ProjDir)\squid_mswin.mak cf_gen_defines.h \ + + +"$(InputDir)\cf.data" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\cf_gen_defines.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/default_config_file.cmd diff -u /dev/null squid/port/win32/default_config_file.cmd:1.1.2.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/default_config_file.cmd Sat Apr 23 03:10:01 2005 @@ -0,0 +1,9 @@ +@echo off +echo /* automatically generated by %0 %* +echo * do not edit +echo */ +echo #define DEFAULT_CONFIG_FILE "%1" +echo #define DEFAULT_SQUID_ERROR_DIR "%2" +echo #define DEFAULT_CACHEMGR_CONFIG "%3" +echo /* Version number of package */ +FOR /F "usebackq skip=2 tokens=2 delims=) " %%i in (`find "AM_INIT_AUTOMAKE" ../../configure.in`) do echo #define VERSION "%%i" Index: squid/port/win32/doc.dsp diff -u /dev/null squid/port/win32/doc.dsp:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/doc.dsp Sun May 1 00:50:11 2005 @@ -0,0 +1,133 @@ +# Microsoft Developer Studio Project File - Name="doc" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=doc - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "doc.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "doc.mak" CFG="doc - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "doc - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "doc - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "doc - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "doc___Win32_Release" +# PROP BASE Intermediate_Dir "doc___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "doc___Win32_Release" +# PROP Intermediate_Dir "doc___Win32_Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "doc - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "doc___Win32_Debug" +# PROP BASE Intermediate_Dir "doc___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "doc___Win32_Debug" +# PROP Intermediate_Dir "doc___Win32_Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "doc - Win32 Release" +# Name "doc - Win32 Debug" +# Begin Source File + +SOURCE=..\..\doc\cachemgr.cgi.8.in + +!IF "$(CFG)" == "doc - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__CACHE="squid_mswin.mak" +# Begin Custom Build +InputDir=\work\nt-2.5\doc +ProjDir=. +InputPath=..\..\doc\cachemgr.cgi.8.in + +"$(InputDir)\cachemgr.cgi.8" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak cachemgr.cgi.8 + +# End Custom Build + +!ELSEIF "$(CFG)" == "doc - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__CACHE="squid_mswin.mak" +# Begin Custom Build +InputDir=\work\nt-2.5\doc +ProjDir=. +InputPath=..\..\doc\cachemgr.cgi.8.in + +"$(InputDir)\cachemgr.cgi.8" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak cachemgr.cgi.8 + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\doc\squid.8.in + +!IF "$(CFG)" == "doc - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__SQUID="squid_mswin.mak" +# Begin Custom Build +InputDir=\work\nt-2.5\doc +ProjDir=. +InputPath=..\..\doc\squid.8.in + +"$(InputDir)\squid.8" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak squid.8 + +# End Custom Build + +!ELSEIF "$(CFG)" == "doc - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__SQUID="squid_mswin.mak" +# Begin Custom Build +InputDir=\work\nt-2.5\doc +ProjDir=. +InputPath=..\..\doc\squid.8.in + +"$(InputDir)\squid.8" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak squid.8 + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/icons.cmd diff -u /dev/null squid/port/win32/icons.cmd:1.1.8.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/icons.cmd Sun Sep 15 12:14:56 2002 @@ -0,0 +1,4 @@ +@echo off +cd /D %1 +sh icons.shar +attrib -r *.gif Index: squid/port/win32/icons.dsp diff -u /dev/null squid/port/win32/icons.dsp:1.1.8.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/icons.dsp Sun Sep 15 12:14:56 2002 @@ -0,0 +1,256 @@ +# Microsoft Developer Studio Project File - Name="icons" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=icons - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "icons.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "icons.mak" CFG="icons - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "icons - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "icons - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "icons - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\icons" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "icons - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\icons" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "icons - Win32 Release" +# Name "icons - Win32 Debug" +# Begin Source File + +SOURCE=..\..\icons\icons.shar + +!IF "$(CFG)" == "icons - Win32 Release" + +# PROP Intermediate_Dir "." +# Begin Custom Build +OutDir=.\..\..\icons +ProjDir=. +InputPath=..\..\icons\icons.shar + +BuildCmds= \ + nmake /f $(ProjDir)\squid_mswin.mak icons + +"$(OutDir)\anthony-binhex.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-bomb.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-box.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-box2.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-c.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-compressed.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dir.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dirup.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dvi.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-f.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-image.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-image2.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-layout.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-link.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-movie.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-pdf.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-portal.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-ps.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-quill.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-script.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-sound.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-tar.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-tex.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-text.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-unknown.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-xbm.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-xpm.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "icons - Win32 Debug" + +# PROP Intermediate_Dir "." +# Begin Custom Build +OutDir=.\..\..\icons +ProjDir=. +InputPath=..\..\icons\icons.shar + +BuildCmds= \ + nmake /f $(ProjDir)\squid_mswin.mak icons + +"$(OutDir)\anthony-binhex.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-bomb.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-box.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-box2.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-c.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-compressed.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dir.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dirup.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-dvi.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-f.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-image.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-image2.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-layout.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-link.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-movie.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-pdf.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-portal.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-ps.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-quill.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-script.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-sound.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-tar.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-tex.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-text.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-unknown.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-xbm.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\anthony-xpm.gif" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/install.dsp diff -u /dev/null squid/port/win32/install.dsp:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/install.dsp Fri May 3 11:39:56 2002 @@ -0,0 +1,94 @@ +# Microsoft Developer Studio Project File - Name="install" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=install - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "install.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "install.mak" CFG="install - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "install - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "install - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "install - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "install - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "install - Win32 Release" +# Name "install - Win32 Debug" +# Begin Source File + +SOURCE=.\update.cmd + +!IF "$(CFG)" == "install - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +ProjDir=. +InputPath=.\update.cmd + +"dummy.file" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(ProjDir)\update.cmd release c:\squid + +# End Custom Build + +!ELSEIF "$(CFG)" == "install - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +ProjDir=. +InputPath=.\update.cmd + +"dummy.file" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(ProjDir)\update.cmd debug c:\squid + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/modules.dsp diff -u /dev/null squid/port/win32/modules.dsp:1.1.2.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/modules.dsp Sun Jun 1 09:07:34 2003 @@ -0,0 +1,205 @@ +# Microsoft Developer Studio Project File - Name="modules" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=modules - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "modules.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "modules.mak" CFG="modules - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "modules - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "modules - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "modules - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\src" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "modules - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "modules___Win32_Debug" +# PROP BASE Intermediate_Dir "modules___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\src" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "modules - Win32 Release" +# Name "modules - Win32 Debug" +# Begin Source File + +SOURCE=.\auth_modules.cmd + +!IF "$(CFG)" == "modules - Win32 Release" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__AUTH_="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\auth_modules.cmd + +"$(OutDir)\auth_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak auth_modules.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "modules - Win32 Debug" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__AUTH_="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\auth_modules.cmd + +"$(OutDir)\auth_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak auth_modules.c + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\default_config_file.cmd + +!IF "$(CFG)" == "modules - Win32 Release" + +USERDEP__DEFAU="squid_mswin.mak" "..\..\configure.in" +# Begin Custom Build +ProjDir=. +InputPath=.\default_config_file.cmd + +"$(ProjDir)\include\default_config_file.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak default_config_file.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "modules - Win32 Debug" + +USERDEP__DEFAU="squid_mswin.mak" "..\..\configure.in" +# Begin Custom Build +ProjDir=. +InputPath=.\default_config_file.cmd + +"$(ProjDir)\include\default_config_file.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak default_config_file.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\repl_modules.cmd + +!IF "$(CFG)" == "modules - Win32 Release" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__REPL_="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\repl_modules.cmd + +"$(OutDir)\repl_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak repl_modules.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "modules - Win32 Debug" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__REPL_="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\repl_modules.cmd + +"$(OutDir)\repl_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak repl_modules.c + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\store_modules.cmd + +!IF "$(CFG)" == "modules - Win32 Release" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__STORE="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\store_modules.cmd + +"$(OutDir)\store_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak store_modules.c + +# End Custom Build + +!ELSEIF "$(CFG)" == "modules - Win32 Debug" + +# PROP Intermediate_Dir "." +# PROP Ignore_Default_Tool 1 +USERDEP__STORE="squid_mswin.mak" +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=.\store_modules.cmd + +"$(OutDir)\store_modules.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + nmake /f $(ProjDir)\squid_mswin.mak store_modules.c + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/readme.txt diff -u /dev/null squid/port/win32/readme.txt:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/readme.txt Sat Jun 14 03:35:44 2003 @@ -0,0 +1,3 @@ +To contact the maintainer of this package, e-mail on squidnt@acmeconsulting.it. +The latest version and documentation can be found on +http://www.acmeconsulting.it/SquidNT.htm. Index: squid/port/win32/repl_modules.cmd diff -u /dev/null squid/port/win32/repl_modules.cmd:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/repl_modules.cmd Wed Mar 27 13:01:10 2002 @@ -0,0 +1,16 @@ +@echo off +if exist %temp%\repl_modules.txt del %temp%\repl_modules.txt +:loop +echo %1 >> %temp%\repl_modules.txt +shift /1 +if NOT "%1"=="" goto :loop +echo /* automatically generated by %0 %* +echo * do not edit +echo */ +echo #include "squid.h" +for /F %%m in (%temp%\repl_modules.txt) do echo extern REMOVALPOLICYCREATE createRemovalPolicy_%%m; +echo void storeReplSetup(void) +echo { +for /F %%m in (%temp%\repl_modules.txt) do echo storeReplAdd("%%m", createRemovalPolicy_%%m); +echo } +if exist %temp%\repl_modules.txt del %temp%\repl_modules.txt Index: squid/port/win32/squid.dsw diff -u /dev/null squid/port/win32/squid.dsw:1.1.2.27 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid.dsw Sun May 1 00:50:11 2005 @@ -0,0 +1,632 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Build"=".\Build.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name cachemgr + End Project Dependency + Begin Project Dependency + Project_Dep_Name dnsserver + End Project Dependency + Begin Project Dependency + Project_Dep_Name fake_auth + End Project Dependency + Begin Project Dependency + Project_Dep_Name ip_user_check + End Project Dependency + Begin Project Dependency + Project_Dep_Name LDAP_auth + End Project Dependency + Begin Project Dependency + Project_Dep_Name LDAP_group + End Project Dependency + Begin Project Dependency + Project_Dep_Name NCSA_auth + End Project Dependency + Begin Project Dependency + Project_Dep_Name nt_auth + End Project Dependency + Begin Project Dependency + Project_Dep_Name ntlm_win32_auth + End Project Dependency + Begin Project Dependency + Project_Dep_Name squid + End Project Dependency + Begin Project Dependency + Project_Dep_Name squidclient + End Project Dependency + Begin Project Dependency + Project_Dep_Name unlinkd + End Project Dependency + Begin Project Dependency + Project_Dep_Name win32_check_group + End Project Dependency + Begin Project Dependency + Project_Dep_Name icons + End Project Dependency + Begin Project Dependency + Project_Dep_Name doc + End Project Dependency +}}} + +############################################################################### + +Project: "LDAP_auth"=".\LDAP_auth\LDAP_auth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "LDAP_group"=".\LDAP_group\LDAP_group.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "NCSA_auth"=".\NCSA_auth\NCSA_auth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "PerlPreprocessing"=".\PerlPreprocessing.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "cachemgr"=".\cachemgr\cachemgr.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "cf_data"=".\cf_data.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "cf_gen"=".\cf_gen\cf_gen.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name cf_data + End Project Dependency +}}} + +############################################################################### + +Project: "dnsserver"=".\dnsserver\dnsserver.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "doc"=".\doc.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "fake_auth"=".\fake_auth\fake_auth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "icons"=".\icons.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "install"=".\install.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name Build + End Project Dependency +}}} + +############################################################################### + +Project: "ip_user_check"=".\ip_user_check\ip_user_check.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "libawin32"=".\libawin32\libawin32.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libbasic"=".\libbasic\libbasic.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libdigest"=".\libdigest\libdigest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libgnuregex"=".\libgnuregex\libgnuregex.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libheap"=".\libheap\libheap.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "liblru"=".\liblru\liblru.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libmiscutil"=".\libmiscutil\libmiscutil.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libntlm"=".\libntlm\libntlm.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libntlmauth"=".\libntlmauth\libntlmauth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libnull"=".\libnull\libnull.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libsnmp"=".\libsnmp\libsnmp.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "libsspwin32"=".\libsspwin32\libsspwin32.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libufs"=".\libufs\libufs.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency +}}} + +############################################################################### + +Project: "modules"=".\modules.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "nt_auth"=".\nt_auth\nt_auth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name libsspwin32 + End Project Dependency +}}} + +############################################################################### + +Project: "ntlm_win32_auth"=".\ntlm_win32_auth\ntlm_win32_auth.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libntlmauth + End Project Dependency + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name libsspwin32 + End Project Dependency +}}} + +############################################################################### + +Project: "pinger"=".\pinger\pinger.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name PerlPreprocessing + End Project Dependency +}}} + +############################################################################### + +Project: "squid"=".\squid\squid.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libgnuregex + End Project Dependency + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name PerlPreprocessing + End Project Dependency + Begin Project Dependency + Project_Dep_Name libntlmauth + End Project Dependency + Begin Project Dependency + Project_Dep_Name libsnmp + End Project Dependency + Begin Project Dependency + Project_Dep_Name modules + End Project Dependency + Begin Project Dependency + Project_Dep_Name squid_conf_default + End Project Dependency + Begin Project Dependency + Project_Dep_Name libbasic + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblru + End Project Dependency + Begin Project Dependency + Project_Dep_Name libntlm + End Project Dependency + Begin Project Dependency + Project_Dep_Name libufs + End Project Dependency + Begin Project Dependency + Project_Dep_Name libawin32 + End Project Dependency + Begin Project Dependency + Project_Dep_Name libheap + End Project Dependency + Begin Project Dependency + Project_Dep_Name libdigest + End Project Dependency + Begin Project Dependency + Project_Dep_Name libnull + End Project Dependency +}}} + +############################################################################### + +Project: "squid_conf_default"=".\squid_conf_default.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name cf_gen + End Project Dependency +}}} + +############################################################################### + +Project: "squidclient"=".\squidclient\squidclient.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Project: "unlinkd"=".\unlinkd\unlinkd.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "win32_check_group"=".\win32_check_group\win32_check_group.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libmiscutil + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + Index: squid/port/win32/squid_conf_default.dsp diff -u /dev/null squid/port/win32/squid_conf_default.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid_conf_default.dsp Wed Mar 27 13:01:10 2002 @@ -0,0 +1,114 @@ +# Microsoft Developer Studio Project File - Name="squid_conf_default" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=squid_conf_default - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "squid_conf_default.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "squid_conf_default.mak" CFG="squid_conf_default - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "squid_conf_default - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "squid_conf_default - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "squid_conf_default - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\src" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=del ..\..\src\squid.conf.default move squid.conf.default ..\..\src\squid.conf.default del ..\..\src\cf_parser.h move cf_parser.h ..\..\src\cf_parser.h +# End Special Build Tool + +!ELSEIF "$(CFG)" == "squid_conf_default - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "squid_conf_default___Win32_Debug" +# PROP BASE Intermediate_Dir "squid_conf_default___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\src" +# PROP Intermediate_Dir "." +# PROP Target_Dir "" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=del ..\..\src\squid.conf.default move squid.conf.default ..\..\src\squid.conf.default del ..\..\src\cf_parser.h move cf_parser.h ..\..\src\cf_parser.h +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "squid_conf_default - Win32 Release" +# Name "squid_conf_default - Win32 Debug" +# Begin Source File + +SOURCE=..\..\src\cf.data + +!IF "$(CFG)" == "squid_conf_default - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=..\..\src\cf.data + +BuildCmds= \ + $(ProjDir)\cf_gen\Release\cf_gen $(InputPath) + +"$(OutDir)\squid.conf.default" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\cf_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "squid_conf_default - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +OutDir=.\..\..\src +ProjDir=. +InputPath=..\..\src\cf.data + +BuildCmds= \ + $(ProjDir)\cf_gen\debug\cf_gen $(InputPath) + +"$(OutDir)\squid.conf.default" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(OutDir)\cf_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project Index: squid/port/win32/squid_mswin.mak diff -u /dev/null squid/port/win32/squid_mswin.mak:1.1.2.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid_mswin.mak Sun Oct 2 08:22:21 2005 @@ -0,0 +1,103 @@ +THISMAKEFILE = squid_mswin.mak + +prefix = c:/squid +exec_prefix = $(prefix)/bin +exec_suffix = .exe +cgi_suffix = .cgi +top_srcdir = ..\.. +bindir = $(exec_prefix) +libexecdir = $(prefix)/libexec +sysconfdir = $(prefix)/etc +datadir = $(prefix)/share +localstatedir = $(prefix)/var +srcdir = ..\..\src +docdir = ..\..\doc +win32includedir = .\include +iconsdir = $(top_srcdir)\icons + +# Gotta love the DOS legacy +# +SQUID_EXE = squid$(exec_suffix) +CLIENT_EXE = client$(exec_suffix) +DNSSERVER_EXE = dnsserver$(exec_suffix) +UNLINKD_EXE = unlinkd$(exec_suffix) +PINGER_EXE = pinger$(exec_suffix) +CACHEMGR_EXE = cachemgr$(cgi_suffix) +DISKD_EXE = diskd$(exec_suffix) + +DEFAULT_HTTP_PORT = 3128 +DEFAULT_ICP_PORT = 3130 +DEFAULT_PREFIX = $(prefix) +DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf +DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf +DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf +DEFAULT_DNSSERVER = $(libexecdir)/$(DNSSERVER_EXE) +DEFAULT_LOG_PREFIX = $(localstatedir)/logs +DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log +DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log +DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log +DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid +DEFAULT_SWAP_DIR = $(localstatedir)/cache +DEFAULT_PINGER = $(libexecdir)/$(PINGER_EXE) +DEFAULT_UNLINKD = $(libexecdir)/$(UNLINKD_EXE) +DEFAULT_DISKD = $(libexecdir)/$(DISKD_EXE) +DEFAULT_ICON_DIR = $(datadir)/icons +DEFAULT_ERROR_DIR = $(datadir)/errors/English +DEFAULT_MIB_PATH = $(datadir)/mib.txt +DEFAULT_HOSTS = none + +AUTH_MODULES = basic ntlm digest +REPL_POLICIES = lru heap +STORE_MODULES = ufs awin32 null + +SUBSTITUTE=sed "\ + s%@DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)%g;\ + s%@DEFAULT_CACHEMGR_CONFIG@%$(DEFAULT_CACHEMGR_CONFIG)%g;\ + s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ + s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ + " + +cf_gen_defines.h: $(srcdir)\cf_gen_defines $(srcdir)\cf.data.pre + gawk -f $(srcdir)\cf_gen_defines <$(srcdir)\cf.data.pre >$(srcdir)\cf_gen_defines.h + +cf.data: $(srcdir)\cf.data.pre .\$(THISMAKEFILE) + sed "\ + s%@DEFAULT_HTTP_PORT@%$(DEFAULT_HTTP_PORT)%g;\ + s%@DEFAULT_ICP_PORT@%$(DEFAULT_ICP_PORT)%g;\ + s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ + s%@DEFAULT_DNSSERVER@%$(DEFAULT_DNSSERVER)%g;\ + s%@DEFAULT_UNLINKD@%$(DEFAULT_UNLINKD)%g;\ + s%@DEFAULT_PINGER@%$(DEFAULT_PINGER)%g;\ + s%@DEFAULT_DISKD@%$(DEFAULT_DISKD)%g;\ + s%@DEFAULT_CACHE_LOG@%$(DEFAULT_CACHE_LOG)%g;\ + s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g;\ + s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\ + s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\ + s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g;\ + s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\ + s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\ + s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ + s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;\ + s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g;"\ + < $(srcdir)\cf.data.pre >$(srcdir)\cf.data + +auth_modules.c: .\auth_modules.cmd .\$(THISMAKEFILE) + .\auth_modules.cmd $(AUTH_MODULES) >$(srcdir)\auth_modules.c + +repl_modules.c: .\repl_modules.cmd .\$(THISMAKEFILE) + .\repl_modules.cmd $(REPL_POLICIES) >$(srcdir)\repl_modules.c + +store_modules.c: .\store_modules.cmd .\$(THISMAKEFILE) + .\store_modules.cmd $(STORE_MODULES) >$(srcdir)\store_modules.c + +default_config_file.h: .\$(THISMAKEFILE) + .\default_config_file.cmd $(DEFAULT_CONFIG_FILE) $(DEFAULT_ERROR_DIR) $(DEFAULT_CACHEMGR_CONFIG) >$(win32includedir)\default_config_file.h + +icons: .\icons.cmd $(iconsdir)\icons.shar + .\icons.cmd $(iconsdir) + +squid.8: $(docdir)\squid.8.in .\$(THISMAKEFILE) + $(SUBSTITUTE) < $(docdir)\squid.8.in > $(docdir)\squid.8 + +cachemgr.cgi.8: $(docdir)\cachemgr.cgi.8.in .\$(THISMAKEFILE) + $(SUBSTITUTE) < $(docdir)\cachemgr.cgi.8.in > $(docdir)\cachemgr.cgi.8 Index: squid/port/win32/store_modules.cmd diff -u /dev/null squid/port/win32/store_modules.cmd:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/store_modules.cmd Wed Mar 27 13:01:10 2002 @@ -0,0 +1,16 @@ +@echo off +if exist %temp%\store_modules.txt del %temp%\store_modules.txt +:loop +echo %1 >> %temp%\store_modules.txt +shift /1 +if NOT "%1"=="" goto :loop +echo /* automatically generated by %0 %* +echo * do not edit +echo */ +echo #include "squid.h" +for /F %%m in (%temp%\store_modules.txt) do echo extern STSETUP storeFsSetup_%%m; +echo void storeFsSetup(void) +echo { +for /F %%m in (%temp%\store_modules.txt) do echo storeFsAdd("%%m", storeFsSetup_%%m); +echo } +if exist %temp%\store_modules.txt del %temp%\store_modules.txt Index: squid/port/win32/update.cmd diff -u /dev/null squid/port/win32/update.cmd:1.1.2.27 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/update.cmd Tue Nov 8 06:44:26 2005 @@ -0,0 +1,63 @@ +@echo off +if %1==release net stop "SquidNT" + +if not exist %2 md %2 +if not exist %2\bin md %2\bin +if not exist %2\sbin md %2\sbin +if not exist %2\libexec md %2\libexec +if not exist %2\docs md %2\docs +if not exist %2\etc md %2\etc +if not exist %2\var\logs md %2\var\logs +if not exist %2\share\errors\english md %2\share\errors\english +if not exist %2\share\errors\italian md %2\share\errors\italian +if not exist %2\share\icons md %2\share\icons + +copy %0\..\squid\%1\squid.exe %2\sbin\squid.exe +copy %0\..\unlinkd\%1\unlinkd.exe %2\libexec\unlinkd.exe +copy %0\..\dnsserver\%1\dnsserver.exe %2\libexec\dnsserver.exe +copy %0\..\pinger\%1\pinger.exe %2\libexec\pinger.exe +copy %0\..\squidclient\%1\squidclient.exe %2\bin\squidclient.exe +copy %0\..\fake_auth\%1\fake_auth.exe %2\libexec\fakeauth_auth.exe +copy %0\..\nt_auth\%1\nt_auth.exe %2\libexec\win32_auth.exe +copy %0\..\ncsa_auth\%1\ncsa_auth.exe %2\libexec\ncsa_auth.exe +copy %0\..\ntlm_win32_auth\%1\ntlm_win32_auth.exe %2\libexec\win32_ntlm_auth.exe +copy %0\..\ldap_auth\%1\ldap_auth.exe %2\libexec\squid_ldap_auth.exe +copy %0\..\ldap_group\%1\ldap_group.exe %2\libexec\squid_ldap_group.exe +copy %0\..\win32_check_group\%1\win32_check_group.exe %2\libexec\win32_check_group.exe +copy %0\..\ip_user_check\%1\ip_user_check.exe %2\libexec\ip_user_check.exe +copy %0\..\cachemgr\%1\cachemgr.exe %2\libexec\cachemgr.cgi + +copy %0\..\..\..\src\squid.conf.default %2\etc\squid.conf.default +copy %0\..\..\..\src\mime.conf.default %2\etc\mime.conf.default +copy %0\..\..\..\src\cachemgr.conf %2\etc\cachemgr.conf.default +copy %0\..\..\..\src\mib.txt %2\share\mib.txt + +copy %0\..\..\..\errors\english\err_* %2\share\errors\english > NUL +copy %0\..\..\..\errors\italian\err_* %2\share\errors\italian > NUL + +copy %0\..\..\..\icons\*.gif %2\share\icons > NUL + +copy %0\..\readme.txt %2\docs\readme.txt +copy %0\..\..\..\helpers\ntlm_auth\NTLMSSP-WIN32\readme.txt %2\docs\win32_ntlm_auth.txt +copy %0\..\..\..\helpers\external_acl\win32_group\readme.txt %2\docs\win32_check_group.txt +copy %0\..\..\..\helpers\external_acl\ip_user\README %2\docs\ip_user_check.txt +copy %0\..\..\..\helpers\basic_auth\win32_locallogon\readme.txt %2\docs\win32_auth.txt +copy %0\..\..\..\doc\win32-relnotes.html %2\docs\win32-relnotes.html +copy %0\..\..\..\doc\debug-sections.txt %2\docs\debug-sections.txt +copy %0\..\..\..\doc\HTTP-codes.txt %2\docs\HTTP-codes.txt +copy %0\..\..\..\doc\release-notes\release-2.5.html %2\docs\release-2.5.html +type %0\..\..\..\helpers\basic_auth\LDAP\squid_ldap_auth.8 | man2htm2 > %2\docs\squid_ldap_auth.html +type %0\..\..\..\helpers\external_acl\LDAP_group\squid_ldap_group.8 | man2htm2 > %2\docs\squid_ldap_group.html +type %0\..\..\..\doc\squid.8 | man2htm2 > %2\docs\squid.html +type %0\..\..\..\doc\cachemgr.cgi.8 | man2htm2 > %2\docs\cachemgr.cgi.html + +copy %0\..\..\..\README %2\README +copy %0\..\..\..\COPYRIGHT %2\COPYRIGHT +copy %0\..\..\..\COPYING %2\COPYING +copy %0\..\..\..\CONTRIBUTORS %2\CONTRIBUTORS +copy %0\..\..\..\CREDITS %2\CREDITS +copy %0\..\..\..\SPONSORS %2\SPONSORS +copy %0\..\..\..\QUICKSTART %2\QUICKSTART +copy %0\..\..\..\ChangeLog %2\ChangeLog + +if %1==release net start "SquidNT" Index: squid/port/win32/LDAP_auth/.cvsignore diff -u /dev/null squid/port/win32/LDAP_auth/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/LDAP_auth/.cvsignore Mon Apr 8 12:27:23 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/LDAP_auth/LDAP_auth.dsp diff -u /dev/null squid/port/win32/LDAP_auth/LDAP_auth.dsp:1.1.2.8 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/LDAP_auth/LDAP_auth.dsp Fri Apr 22 12:08:52 2005 @@ -0,0 +1,109 @@ +# Microsoft Developer Studio Project File - Name="LDAP_auth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=LDAP_auth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "LDAP_auth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "LDAP_auth.mak" CFG="LDAP_auth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "LDAP_auth - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "LDAP_auth - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "LDAP_auth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 Wldap32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "LDAP_auth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Wldap32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "LDAP_auth - Win32 Release" +# Name "LDAP_auth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\basic_auth\LDAP\squid_ldap_auth.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/LDAP_group/.cvsignore diff -u /dev/null squid/port/win32/LDAP_group/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/LDAP_group/.cvsignore Sat Nov 30 05:55:04 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/LDAP_group/LDAP_group.dsp diff -u /dev/null squid/port/win32/LDAP_group/LDAP_group.dsp:1.1.4.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/LDAP_group/LDAP_group.dsp Fri Apr 22 12:08:52 2005 @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="LDAP_group" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=LDAP_group - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "LDAP_group.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "LDAP_group.mak" CFG="LDAP_group - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "LDAP_group - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "LDAP_group - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "LDAP_group - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib Wldap32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "LDAP_group - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib Wldap32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "LDAP_group - Win32 Release" +# Name "LDAP_group - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\ldap_group\squid_ldap_group.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/NCSA_auth/.cvsignore diff -u /dev/null squid/port/win32/NCSA_auth/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/NCSA_auth/.cvsignore Sat Apr 13 10:11:41 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/NCSA_auth/NCSA_auth.dsp diff -u /dev/null squid/port/win32/NCSA_auth/NCSA_auth.dsp:1.1.4.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/NCSA_auth/NCSA_auth.dsp Fri Apr 22 12:08:52 2005 @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="NCSA_auth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=NCSA_auth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "NCSA_auth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "NCSA_auth.mak" CFG="NCSA_auth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "NCSA_auth - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "NCSA_auth - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "NCSA_auth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "NCSA_auth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "NCSA_auth - Win32 Release" +# Name "NCSA_auth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\src\encrypt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\helpers\basic_auth\NCSA\ncsa_auth.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/cachemgr/.cvsignore diff -u /dev/null squid/port/win32/cachemgr/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/cachemgr/.cvsignore Mon Apr 8 12:27:23 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/cachemgr/cachemgr.dsp diff -u /dev/null squid/port/win32/cachemgr/cachemgr.dsp:1.1.2.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/cachemgr/cachemgr.dsp Fri Apr 22 12:08:52 2005 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="cachemgr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=cachemgr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cachemgr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cachemgr.mak" CFG="cachemgr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cachemgr - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "cachemgr - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "cachemgr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../src" /I "../../../include" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "cachemgr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "cachemgr - Win32 Release" +# Name "cachemgr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\cachemgr.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\snprintf.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\util.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/cf_gen/.cvsignore diff -u /dev/null squid/port/win32/cf_gen/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/cf_gen/.cvsignore Mon Apr 8 12:27:23 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/cf_gen/cf_gen.dsp diff -u /dev/null squid/port/win32/cf_gen/cf_gen.dsp:1.1.2.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/cf_gen/cf_gen.dsp Fri Apr 22 12:08:52 2005 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="cf_gen" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=cf_gen - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "cf_gen.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "cf_gen.mak" CFG="cf_gen - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "cf_gen - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "cf_gen - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "cf_gen - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../include" /I "../" /I "../../src../include" /I "../../../include" /I "../../" /I "../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "cf_gen - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../" /I "../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "cf_gen - Win32 Release" +# Name "cf_gen - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\cf_gen.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\cf_gen_defines.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\config.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/dnsserver/.cvsignore diff -u /dev/null squid/port/win32/dnsserver/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/dnsserver/.cvsignore Mon Apr 8 12:18:38 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/dnsserver/dnsserver.dsp diff -u /dev/null squid/port/win32/dnsserver/dnsserver.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/dnsserver/dnsserver.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="dnsserver" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=dnsserver - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dnsserver.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dnsserver.mak" CFG="dnsserver - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dnsserver - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "dnsserver - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "dnsserver - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "dnsserver - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "dnsserver - Win32 Release" +# Name "dnsserver - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\dnsserver.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/fake_auth/.cvsignore diff -u /dev/null squid/port/win32/fake_auth/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/fake_auth/.cvsignore Mon Apr 8 12:27:23 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/fake_auth/fake_auth.dsp diff -u /dev/null squid/port/win32/fake_auth/fake_auth.dsp:1.1.2.7 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/fake_auth/fake_auth.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="fake_auth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=fake_auth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "fake_auth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "fake_auth.mak" CFG="fake_auth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "fake_auth - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "fake_auth - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "fake_auth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "fake_auth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "fake_auth - Win32 Release" +# Name "fake_auth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\ntlm_auth\fakeauth\fakeauth_auth.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\helpers\ntlm_auth\fakeauth\ntlm.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/include/.cvsignore diff -u /dev/null squid/port/win32/include/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/.cvsignore Sun Apr 18 01:04:55 2004 @@ -0,0 +1,2 @@ +.cvsignore +default_config_file.h Index: squid/port/win32/include/Readdir.h diff -u /dev/null squid/port/win32/include/Readdir.h:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/Readdir.h Fri Jul 8 14:34:06 2005 @@ -0,0 +1,33 @@ +/* + * Structures and types used to implement opendir/readdir/closedir + * on Windows 95/NT. +*/ + +#include +#include +#include + +#ifdef _MSC_VER /* Microsoft C Compiler ONLY */ +/* struct dirent - same as Unix */ +struct dirent { + ino_t d_ino; /* inode (always 1 in WIN32) */ + off_t d_off; /* offset to this dirent */ + unsigned short d_reclen; /* length of d_name */ + char d_name[_MAX_FNAME+1]; /* filename (null terminated) */ +}; + +/* typedef DIR - not the same as Unix */ +typedef struct { + long handle; /* _findfirst/_findnext handle */ + short offset; /* offset into directory */ + short finished; /* 1 if there are not more files */ + struct _finddata_t fileinfo; /* from _findfirst/_findnext */ + char *dir; /* the dir we are reading */ + struct dirent dent; /* the dirent to return */ +} DIR; + +/* Function prototypes */ +DIR * opendir(const char *); +struct dirent * readdir(DIR *); +int closedir(DIR *); +#endif Index: squid/port/win32/include/autoconf.h diff -u /dev/null squid/port/win32/include/autoconf.h:1.1.2.43 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/autoconf.h Sat Mar 11 09:07:50 2006 @@ -0,0 +1,1002 @@ +/* include/autoconf.h. Generated by configure. */ +/* include/autoconf.h.in. Generated from configure.in by autoheader. */ +/* + * All configurable options are enabled by using --enable-.... + * when running configure. See configure --help for a list + * of all available options. + * + * You are free to edit this file, but it will be overwritten + * each time you run configure. You may need to edit this file + * if configure falsely picks up a library function or structure + * that doesn't really work on your system. + * + * Another way to block a function that should not be detected + * is to + * setenv ac_cv_func_ no + * before running configure, as in + * setenv ac_cv_func_setresuid no + * + * It is possible to enable some of the configurable options + * by editing this file alone, but some of them requires changes + * in the Makefiles, wich is done automatically by configure. + * + */ + +#ifndef __CONFIGURE_H__ +#define __CONFIGURE_H__ +/* $Id$ */ + +/* + * configure command line used to configure Squid + */ + +#undef SQUID_CONFIGURE_OPTIONS + +/********************************* + * START OF CONFIGURABLE OPTIONS * + *********************************/ +/* + * If you are upset that the cachemgr.cgi form comes up with the hostname + * field blank, then define this to getfullhostname() + */ +/* #undef CACHEMGR_HOSTNAME */ + +/* + * What default TCP port to use for HTTP listening? + */ +#ifndef CACHE_HTTP_PORT +#define CACHE_HTTP_PORT 3128 +#endif + +/* + * What default UDP port to use for ICP listening? + */ +#ifndef CACHE_ICP_PORT +#define CACHE_ICP_PORT 3130 +#endif + +/* Define to do simple malloc debugging */ +/* #undef XMALLOC_DEBUG */ + +/* Define for log file trace of mem alloc/free */ +/* #undef MEM_GEN_TRACE */ + +/* Define to have malloc statistics */ +/* #undef XMALLOC_STATISTICS */ + +/* Define to have a detailed trace of memory allocations */ +/* #undef XMALLOC_TRACE */ + +/* #undef FORW_VIA_DB */ + +/* Defines how many threads aufs uses for I/O */ +/* #undef AUFS_IO_THREADS */ + +/* + * If you want to use Squid's ICMP features (highly recommended!) then + * define this. When USE_ICMP is defined, Squid will send ICMP pings + * to origin server sites. This information is used in numerous ways: + * - Sent in ICP replies so neighbor caches know how close + * you are to the source. + * - For finding the closest instance of a URN. + * - With the 'test_reachability' option. Squid will return + * ICP_OP_MISS_NOFETCH for sites which it cannot ping. + */ +/* #undef USE_ICMP */ + +/* + * Traffic management via "delay pools". + */ +/* #undef DELAY_POOLS */ + +/* + * If you want to log User-Agent request header values, define this. + * By default, they are written to useragent.log in the Squid log + * directory. + */ +#define USE_USERAGENT_LOG 1 + +/* + * If you want to log Referer request header values, define this. + * By default, they are written to referer.log in the Squid log + * directory. + */ +#define USE_REFERER_LOG 1 + +/* + * A dangerous feature which causes Squid to kill its parent process + * (presumably the RunCache script) upon receipt of SIGTERM or SIGINT. + * Use with caution. + */ +/* #undef KILL_PARENT_OPT */ + +/* Define to enable SNMP monitoring of Squid */ +#define SQUID_SNMP 1 + +/* + * Define to enable WCCP + */ +/* #undef USE_WCCP */ + +/* + * Squid frequently calls gettimeofday() for accurate timestamping. + * If you are concerned that gettimeofday() is called too often, and + * could be causing performance degradation, then you can define + * ALARM_UPDATES_TIME and cause Squid's clock to be updated at regular + * intervals (one second) with ALARM signals. + */ +/* #undef ALARM_UPDATES_TIME */ + +/* + * Define this to include code which lets you specify access control + * elements based on ethernet hardware addresses. This code uses + * functions found in 4.4 BSD derviations (e.g. FreeBSD, ?). + */ +#define USE_ARP_ACL 1 + +/* + * Define this to include code for the Hypertext Cache Protocol (HTCP) + */ +#define USE_HTCP 1 + +/* + * Use Cache Digests for locating objects in neighbor caches. This + * code is still semi-experimental. + */ +#define USE_CACHE_DIGESTS 1 + +/* + * Cache Array Routing Protocol + */ +/* #undef USE_CARP */ + +/* Define if NTLM is allowed to fail gracefully when a helper has problems */ +/* #undef NTLM_FAIL_OPEN */ + +/* + * Define Windows NT & Windows 2000 run service mode + */ +#define USE_WIN32_SERVICE 1 + +/******************************** + * END OF CONFIGURABLE OPTIONS * + ********************************/ + +/* Define if struct tm has tm_gmtoff member */ +/* #undef HAVE_TM_GMTOFF */ + +/* Define if struct mallinfo has mxfast member */ +/* #undef HAVE_EXT_MALLINFO */ + +/* Default FD_SETSIZE value */ +#define DEFAULT_FD_SETSIZE 64 + +/* Maximum number of open filedescriptors */ +#define SQUID_MAXFD 2048 + +/* UDP send buffer size */ +#define SQUID_UDP_SO_SNDBUF 8192 + +/* UDP receive buffer size */ +#define SQUID_UDP_SO_RCVBUF 8192 + +/* TCP send buffer size */ +#define SQUID_TCP_SO_SNDBUF 8192 + +/* TCP receive buffer size */ +#define SQUID_TCP_SO_RCVBUF 8192 + +/* Host type from configure */ +#define CONFIG_HOST_TYPE "i686-pc-winnt" + +/* If we need to declare sys_errlist[] as external */ +/* #undef NEED_SYS_ERRLIST */ + +/* If gettimeofday is known to take only one argument */ +/* #undef GETTIMEOFDAY_NO_TZP */ + +/* If libresolv.a has been hacked to export _dns_ttl_ */ +/* #undef LIBRESOLV_DNS_TTL_HACK */ + +/* Define if struct ip has ip_hl member */ +/* #undef HAVE_IP_HL */ + +/* Define if your compiler supports prototyping */ +/* #undef HAVE_ANSI_PROTOTYPES */ + +/* Define if we should use GNU regex */ +#define USE_GNUREGEX 1 + +/* signed size_t, grr */ +/* #undef ssize_t */ + +/* + * Yay! Another Linux brokenness. Its not good enough to know that + * setresuid() exists, because RedHat 5.0 declare setresuid() but + * doesn't implement it. + */ +/* #undef HAVE_SETRESUID */ + +/* Define if you have struct rusage */ +#define HAVE_STRUCT_RUSAGE 1 + +/* Define if you have PSAPI.DLL on Windows systems */ +#define HAVE_WIN32_PSAPI 1 + +/* + * This makes warnings go away. If you have socklen_t defined in your + * /usr/include files, then this should remain undef'd. Otherwise it + * should be defined to int. + */ +#define socklen_t int + +/* + * By default (for now anyway) Squid includes options which allows + * the cache administrator to violate the HTTP protocol specification + * in terms of cache behaviour. Setting this to '0' will disable + * such code. + */ +#define HTTP_VIOLATIONS 1 + +/* + * Enable support for Transparent Proxy on systems using IP-Filter + * address redirection. This provides "masquerading" support for non + * Linux system. + */ +/* #undef IPF_TRANSPARENT */ + +/* + * Enable support for Transparent Proxy on systems using PF address + * redirection. This provides "masquerading" support for OpenBSD. + */ +/* #undef PF_TRANSPARENT */ + +/* + * Enable code for assiting in finding memory leaks. Hacker stuff only. + */ +/* #undef USE_LEAKFINDER */ + +/* + * type of fd_set array + */ +#define fd_mask int + +/* + * If _res structure has nsaddr_list member + */ +/* #undef HAVE_RES_NSADDR_LIST */ + +/* + * If _res structure has ns_list member + */ +/* #undef HAVE_RES_NS_LIST */ + +/* + * Compile in support for Ident (RFC 931) lookups? Enabled by default. + */ +#define USE_IDENT 1 + +/* + * If your system has statvfs(), and if it actually works! + */ +/* #undef HAVE_STATVFS */ + +/* + * If --disable-internal-dns was given to configure, then we'll use + * the dnsserver processes instead. + */ +/* #undef USE_DNSSERVERS */ + +/* + * we check for the existance of struct mallinfo + */ +/* #undef HAVE_STRUCT_MALLINFO */ + +/* + * Some systems dont have va_copy */ +/* #undef HAVE_VA_COPY */ + +/* + * Some systems support __va_copy */ +/* #undef HAVE___VA_COPY */ + + +/* + * Do we want to use truncate(2) or unlink(2)? + */ +/* #undef USE_TRUNCATE */ + +/* + * Allow underscores in host names + */ +#define ALLOW_HOSTNAME_UNDERSCORES 1 + +/* + * Use the heap-based replacement techniques + */ +/* #undef HEAP_REPLACEMENT */ + +/* + * message type for message queues + */ +#define mtyp_t long + +/* + * Define this to include code for SSL encryption. + */ +/* #undef USE_SSL */ + +/* + * Define this to make use of the OpenSSL libraries for + * MD5 calculation rather than Squid's own MD5 implementation + * or if building with SSL encryption (USE_SSL) + */ +/* #undef USE_OPENSSL */ + +/* Define if you want to set the COSS membuf size */ +/* #undef COSS_MEMBUF_SZ */ + +/* Print stacktraces on fatal errors */ +/* #undef PRINT_STACK_TRACE */ + +/* + * Define this if unlinkd is required + * (strongly recommended for ufs storage type) + */ +#define USE_UNLINKD 1 + +/* + * Enable support for Transparent Proxy on Linux 2.4 systems + */ +/* #undef LINUX_NETFILTER */ + +/* + * Do we have unix sockets? (required for the winbind ntlm helper + */ +/* #undef HAVE_UNIXSOCKET */ + +/* + * Known-size integers + */ + +#define int16_t short + +#define u_int16_t unsigned short + +#define int32_t int + +#define u_int32_t unsigned int + +#define int64_t __int64 + +#define u_int64_t unsigned __int64 + +/* The number of bytes in a __int64. */ +#define SIZEOF___INT64 8 + +/* The number of bytes in a int16_t. */ +#define SIZEOF_INT16_T 2 + +/* The number of bytes in a int32_t. */ +#define SIZEOF_INT32_T 4 + +/* The number of bytes in a int64_t. */ +#define SIZEOF_INT64_T 8 + +/* The number of bytes in a off_t. */ +#define SIZEOF_OFF_T 4 + +/* The number of bytes in a size_t. */ +#define SIZEOF_SIZE_T 4 + +/* The number of bytes in a u_int16_t. */ +#define SIZEOF_U_INT16_T 2 + +/* The number of bytes in a u_int32_t. */ +#define SIZEOF_U_INT32_T 4 + +/* The number of bytes in a u_int64_t. */ +#define SIZEOF_U_INT64_T 8 + +/* The number of bytes in a uint16_t. */ +#define SIZEOF_UINT16_T 2 + +/* The number of bytes in a uint32_t. */ +#define SIZEOF_UINT32_T 4 + +/* The number of bytes in a uint64_t. */ +#define SIZEOF_UINT64_T 8 + +/* + * Enable support for the X-Accelerator-Vary HTTP header + */ +/* #undef X_ACCELERATOR_VARY */ + + +/* Enable hostname sanity checks */ +#define CHECK_HOSTNAMES 1 + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_NAMESER_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `backtrace_symbols_fd' function. */ +/* #undef HAVE_BACKTRACE_SYMBOLS_FD */ + +/* Define to 1 if you have the `bcopy' function. */ +/* #undef HAVE_BCOPY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSTRING_H */ + +/* Define to 1 if you have the `bswap_16' function. */ +/* #undef HAVE_BSWAP_16 */ + +/* Define to 1 if you have the `bswap_32' function. */ +/* #undef HAVE_BSWAP_32 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the `crypt' function. */ +#define HAVE_CRYPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CRYPT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the `drand48' function. */ +/* #undef HAVE_DRAND48 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `fchmod' function. */ +/* #undef HAVE_FCHMOD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getdtablesize' function. */ +/* #undef HAVE_GETDTABLESIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getpass' function. */ +/* #undef HAVE_GETPASS */ + +/* Define to 1 if you have the `getrlimit' function. */ +/* #undef HAVE_GETRLIMIT */ + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `getspnam' function. */ +/* #undef HAVE_GETSPNAM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GLIB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GNUMALLOC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GRP_H */ + +/* Define to 1 if you have the `initgroups' function. */ +/* #undef HAVE_INITGROUPS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_FIL_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_FIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_NAT_H */ + +/* Define to 1 if you have the `44bsd' library (-l44bsd). */ +/* #undef HAVE_LIB44BSD */ + +/* Define to 1 if you have the `bind' library (-lbind). */ +/* #undef HAVE_LIBBIND */ + +/* Define to 1 if you have the `bsd' library (-lbsd). */ +/* #undef HAVE_LIBBSD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBC_H */ + +/* Define to 1 if you have the `dl' library (-ldl). */ +/* #undef HAVE_LIBDL */ + +/* Define to 1 if you have the `gnumalloc' library (-lgnumalloc). */ +/* #undef HAVE_LIBGNUMALLOC */ + +/* Define to 1 if you have the `intl' library (-lintl). */ +/* #undef HAVE_LIBINTL */ + +/* Define to 1 if you have the `m' library (-lm). */ +/* #undef HAVE_LIBM */ + +/* Define to 1 if you have the `malloc' library (-lmalloc). */ +/* #undef HAVE_LIBMALLOC */ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* #undef HAVE_LIBPTHREAD */ + +/* Define to 1 if you have the `resolv' library (-lresolv). */ +/* #undef HAVE_LIBRESOLV */ + +/* Define to 1 if you have the `rt' library (-lrt). */ +/* #undef HAVE_LIBRT */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_NETFILTER_IPV4_H */ + +/* Define to 1 if you have the `lrand48' function. */ +/* #undef HAVE_LRAND48 */ + +/* Define to 1 if you have the `mallinfo' function. */ +/* #undef HAVE_MALLINFO */ + +/* Define to 1 if you have the `mallocblksize' function. */ +/* #undef HAVE_MALLOCBLKSIZE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MALLOC_H */ + +/* Define to 1 if you have the `mallopt' function. */ +/* #undef HAVE_MALLOPT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `mkstemp' function. */ +/* #undef HAVE_MKSTEMP */ + +/* Define to 1 if you have the `mktime' function. */ +#define HAVE_MKTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MOUNT_H */ + +/* Define to 1 if you have the `mstats' function. */ +/* #undef HAVE_MSTATS */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IF_ETHER_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_FIL_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_FIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_NAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_PFVAR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_COMMON_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENSSL_ERR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENSSL_MD5_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENSSL_SSL_H */ + +/* Define to 1 if you have the `poll' function. */ +/* #undef HAVE_POLL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_POLL_H */ + +/* Define to 1 if you have the `pthread_attr_setschedparam' function. */ +/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ + +/* Define to 1 if you have the `pthread_attr_setscope' function. */ +/* #undef HAVE_PTHREAD_ATTR_SETSCOPE */ + +/* Define to 1 if you have the `pthread_setschedparam' function. */ +/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ + +/* Define to 1 if you have the `pthread_sigmask' function. */ +/* #undef HAVE_PTHREAD_SIGMASK */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PWD_H */ + +/* Define to 1 if you have the `random' function. */ +/* #undef HAVE_RANDOM */ + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the `regexec' function. */ +#define HAVE_REGEXEC 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define to 1 if you have the `regfree' function. */ +#define HAVE_REGFREE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_RESOLV_H */ + +/* Define to 1 if you have the `res_init' function. */ +/* #undef HAVE_RES_INIT */ + +/* Define to 1 if you have the `rint' function. */ +/* #undef HAVE_RINT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SASL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SASL_SASL_H */ + +/* Define to 1 if you have the `sbrk' function. */ +/* #undef HAVE_SBRK */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Define to 1 if you have the `seteuid' function. */ +/* #undef HAVE_SETEUID */ + +/* Define to 1 if you have the `setgroups' function. */ +/* #undef HAVE_SETGROUPS */ + +/* Define to 1 if you have the `setpgrp' function. */ +/* #undef HAVE_SETPGRP */ + +/* Define to 1 if you have the `setrlimit' function. */ +/* #undef HAVE_SETRLIMIT */ + +/* Define to 1 if you have the `setsid' function. */ +/* #undef HAVE_SETSID */ + +/* Define to 1 if you have the `sigaction' function. */ +/* #undef HAVE_SIGACTION */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `srand48' function. */ +/* #undef HAVE_SRAND48 */ + +/* Define to 1 if you have the `srandom' function. */ +/* #undef HAVE_SRANDOM */ + +/* Define to 1 if you have the `statfs' function. */ +#define HAVE_STATFS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSCALL_H */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the `syslog' function. */ +/* #undef HAVE_SYSLOG */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSLOG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BITYPES_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IOCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MSG_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_RESOURCE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STATVFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VFS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define to 1 if you have the `tempnam' function. */ +#define HAVE_TEMPNAM 1 + +/* Define to 1 if you have the `timegm' function. */ +/* #undef HAVE_TIMEGM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_VARARGS_H 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Support large cache files > 2GB */ +#define LARGE_CACHE_FILES 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "squid" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of a `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of a `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of a `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if does not define. */ +/* #undef fd_mask */ + +/* Define to `int' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +#define pid_t int + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#if DELAY_POOLS +#define STR_DELAY_POOLS "--enable-delay-pools " +#else +#define STR_DELAY_POOLS "" +#endif +#if USE_ICMP +#define STR_USE_ICMP "--enable-icmp " +#else +#define STR_USE_ICMP "" +#endif +#if USE_DNSSERVERS +#define STR_USE_DNSSERVERS "--disable-internal-dns " +#else +#define STR_USE_DNSSERVERS "" +#endif +#if USE_SSL +#define STR_USE_SSL "--enable-ssl " +#else +#define STR_USE_SSL "" +#endif +#if USE_CARP +#define STR_USE_CARP "--enable-carp " +#else +#define STR_USE_CARP "" +#endif +#if USE_ARP_ACL +#define STR_USE_ARP_ACL "--enable-arp-acl " +#else +#define STR_USE_ARP_ACL "" +#endif + +#define SQUID_CONFIGURE_OPTIONS "--enable-win32-service --enable-underscores --enable-storeio='ufs awin32 null' " \ + "--enable-removal-policies='heap lru' --enable-snmp --enable-htcp --disable-wccp --enable-useragent-log " \ + "--enable-referer-log --enable-auth='basic ntlm digest' --enable-basic-auth-helpers='LDAP ncsa_auth win32_locallogon' " \ + "--enable-ntlm-auth-helpers=NTLMSSP-WIN32 --enable-external-acl-helpers='win32_group ldap_group' --enable-large-cache-files "\ + STR_DELAY_POOLS \ + STR_USE_ICMP \ + STR_USE_DNSSERVERS \ + STR_USE_SSL \ + STR_USE_CARP \ + STR_USE_ARP_ACL \ + "--prefix=c:/squid" + +#endif /* __CONFIGURE_H__ */ Index: squid/port/win32/include/autoconf.h.ssl diff -u /dev/null squid/port/win32/include/autoconf.h.ssl:1.1.2.6 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/autoconf.h.ssl Sat Mar 11 09:07:50 2006 @@ -0,0 +1,1002 @@ +/* include/autoconf.h. Generated by configure. */ +/* include/autoconf.h.in. Generated from configure.in by autoheader. */ +/* + * All configurable options are enabled by using --enable-.... + * when running configure. See configure --help for a list + * of all available options. + * + * You are free to edit this file, but it will be overwritten + * each time you run configure. You may need to edit this file + * if configure falsely picks up a library function or structure + * that doesn't really work on your system. + * + * Another way to block a function that should not be detected + * is to + * setenv ac_cv_func_ no + * before running configure, as in + * setenv ac_cv_func_setresuid no + * + * It is possible to enable some of the configurable options + * by editing this file alone, but some of them requires changes + * in the Makefiles, wich is done automatically by configure. + * + */ + +#ifndef __CONFIGURE_H__ +#define __CONFIGURE_H__ +/* $Id$ */ + +/* + * configure command line used to configure Squid + */ + +#undef SQUID_CONFIGURE_OPTIONS + +/********************************* + * START OF CONFIGURABLE OPTIONS * + *********************************/ +/* + * If you are upset that the cachemgr.cgi form comes up with the hostname + * field blank, then define this to getfullhostname() + */ +/* #undef CACHEMGR_HOSTNAME */ + +/* + * What default TCP port to use for HTTP listening? + */ +#ifndef CACHE_HTTP_PORT +#define CACHE_HTTP_PORT 3128 +#endif + +/* + * What default UDP port to use for ICP listening? + */ +#ifndef CACHE_ICP_PORT +#define CACHE_ICP_PORT 3130 +#endif + +/* Define to do simple malloc debugging */ +/* #undef XMALLOC_DEBUG */ + +/* Define for log file trace of mem alloc/free */ +/* #undef MEM_GEN_TRACE */ + +/* Define to have malloc statistics */ +/* #undef XMALLOC_STATISTICS */ + +/* Define to have a detailed trace of memory allocations */ +/* #undef XMALLOC_TRACE */ + +/* #undef FORW_VIA_DB */ + +/* Defines how many threads aufs uses for I/O */ +/* #undef AUFS_IO_THREADS */ + +/* + * If you want to use Squid's ICMP features (highly recommended!) then + * define this. When USE_ICMP is defined, Squid will send ICMP pings + * to origin server sites. This information is used in numerous ways: + * - Sent in ICP replies so neighbor caches know how close + * you are to the source. + * - For finding the closest instance of a URN. + * - With the 'test_reachability' option. Squid will return + * ICP_OP_MISS_NOFETCH for sites which it cannot ping. + */ +/* #undef USE_ICMP */ + +/* + * Traffic management via "delay pools". + */ +/* #undef DELAY_POOLS */ + +/* + * If you want to log User-Agent request header values, define this. + * By default, they are written to useragent.log in the Squid log + * directory. + */ +#define USE_USERAGENT_LOG 1 + +/* + * If you want to log Referer request header values, define this. + * By default, they are written to referer.log in the Squid log + * directory. + */ +#define USE_REFERER_LOG 1 + +/* + * A dangerous feature which causes Squid to kill its parent process + * (presumably the RunCache script) upon receipt of SIGTERM or SIGINT. + * Use with caution. + */ +/* #undef KILL_PARENT_OPT */ + +/* Define to enable SNMP monitoring of Squid */ +#define SQUID_SNMP 1 + +/* + * Define to enable WCCP + */ +/* #undef USE_WCCP */ + +/* + * Squid frequently calls gettimeofday() for accurate timestamping. + * If you are concerned that gettimeofday() is called too often, and + * could be causing performance degradation, then you can define + * ALARM_UPDATES_TIME and cause Squid's clock to be updated at regular + * intervals (one second) with ALARM signals. + */ +/* #undef ALARM_UPDATES_TIME */ + +/* + * Define this to include code which lets you specify access control + * elements based on ethernet hardware addresses. This code uses + * functions found in 4.4 BSD derviations (e.g. FreeBSD, ?). + */ +#define USE_ARP_ACL 1 + +/* + * Define this to include code for the Hypertext Cache Protocol (HTCP) + */ +#define USE_HTCP 1 + +/* + * Use Cache Digests for locating objects in neighbor caches. This + * code is still semi-experimental. + */ +#define USE_CACHE_DIGESTS 1 + +/* + * Cache Array Routing Protocol + */ +/* #undef USE_CARP */ + +/* Define if NTLM is allowed to fail gracefully when a helper has problems */ +/* #undef NTLM_FAIL_OPEN */ + +/* + * Define Windows NT & Windows 2000 run service mode + */ +#define USE_WIN32_SERVICE 1 + +/******************************** + * END OF CONFIGURABLE OPTIONS * + ********************************/ + +/* Define if struct tm has tm_gmtoff member */ +/* #undef HAVE_TM_GMTOFF */ + +/* Define if struct mallinfo has mxfast member */ +/* #undef HAVE_EXT_MALLINFO */ + +/* Default FD_SETSIZE value */ +#define DEFAULT_FD_SETSIZE 64 + +/* Maximum number of open filedescriptors */ +#define SQUID_MAXFD 2048 + +/* UDP send buffer size */ +#define SQUID_UDP_SO_SNDBUF 8192 + +/* UDP receive buffer size */ +#define SQUID_UDP_SO_RCVBUF 8192 + +/* TCP send buffer size */ +#define SQUID_TCP_SO_SNDBUF 8192 + +/* TCP receive buffer size */ +#define SQUID_TCP_SO_RCVBUF 8192 + +/* Host type from configure */ +#define CONFIG_HOST_TYPE "i686-pc-winnt" + +/* If we need to declare sys_errlist[] as external */ +/* #undef NEED_SYS_ERRLIST */ + +/* If gettimeofday is known to take only one argument */ +/* #undef GETTIMEOFDAY_NO_TZP */ + +/* If libresolv.a has been hacked to export _dns_ttl_ */ +/* #undef LIBRESOLV_DNS_TTL_HACK */ + +/* Define if struct ip has ip_hl member */ +/* #undef HAVE_IP_HL */ + +/* Define if your compiler supports prototyping */ +/* #undef HAVE_ANSI_PROTOTYPES */ + +/* Define if we should use GNU regex */ +#define USE_GNUREGEX 1 + +/* signed size_t, grr */ +/* #undef ssize_t */ + +/* + * Yay! Another Linux brokenness. Its not good enough to know that + * setresuid() exists, because RedHat 5.0 declare setresuid() but + * doesn't implement it. + */ +/* #undef HAVE_SETRESUID */ + +/* Define if you have struct rusage */ +#define HAVE_STRUCT_RUSAGE 1 + +/* Define if you have PSAPI.DLL on Windows systems */ +#define HAVE_WIN32_PSAPI 1 + +/* + * This makes warnings go away. If you have socklen_t defined in your + * /usr/include files, then this should remain undef'd. Otherwise it + * should be defined to int. + */ +#define socklen_t int + +/* + * By default (for now anyway) Squid includes options which allows + * the cache administrator to violate the HTTP protocol specification + * in terms of cache behaviour. Setting this to '0' will disable + * such code. + */ +#define HTTP_VIOLATIONS 1 + +/* + * Enable support for Transparent Proxy on systems using IP-Filter + * address redirection. This provides "masquerading" support for non + * Linux system. + */ +/* #undef IPF_TRANSPARENT */ + +/* + * Enable support for Transparent Proxy on systems using PF address + * redirection. This provides "masquerading" support for OpenBSD. + */ +/* #undef PF_TRANSPARENT */ + +/* + * Enable code for assiting in finding memory leaks. Hacker stuff only. + */ +/* #undef USE_LEAKFINDER */ + +/* + * type of fd_set array + */ +#define fd_mask int + +/* + * If _res structure has nsaddr_list member + */ +/* #undef HAVE_RES_NSADDR_LIST */ + +/* + * If _res structure has ns_list member + */ +/* #undef HAVE_RES_NS_LIST */ + +/* + * Compile in support for Ident (RFC 931) lookups? Enabled by default. + */ +#define USE_IDENT 1 + +/* + * If your system has statvfs(), and if it actually works! + */ +/* #undef HAVE_STATVFS */ + +/* + * If --disable-internal-dns was given to configure, then we'll use + * the dnsserver processes instead. + */ +/* #undef USE_DNSSERVERS */ + +/* + * we check for the existance of struct mallinfo + */ +/* #undef HAVE_STRUCT_MALLINFO */ + +/* + * Some systems dont have va_copy */ +/* #undef HAVE_VA_COPY */ + +/* + * Some systems support __va_copy */ +/* #undef HAVE___VA_COPY */ + + +/* + * Do we want to use truncate(2) or unlink(2)? + */ +/* #undef USE_TRUNCATE */ + +/* + * Allow underscores in host names + */ +#define ALLOW_HOSTNAME_UNDERSCORES 1 + +/* + * Use the heap-based replacement techniques + */ +/* #undef HEAP_REPLACEMENT */ + +/* + * message type for message queues + */ +#define mtyp_t long + +/* + * Define this to include code for SSL encryption. + */ +#define USE_SSL 1 + +/* + * Define this to make use of the OpenSSL libraries for + * MD5 calculation rather than Squid's own MD5 implementation + * or if building with SSL encryption (USE_SSL) + */ +#define USE_OPENSSL 1 + +/* Define if you want to set the COSS membuf size */ +/* #undef COSS_MEMBUF_SZ */ + +/* Print stacktraces on fatal errors */ +/* #undef PRINT_STACK_TRACE */ + +/* + * Define this if unlinkd is required + * (strongly recommended for ufs storage type) + */ +#define USE_UNLINKD 1 + +/* + * Enable support for Transparent Proxy on Linux 2.4 systems + */ +/* #undef LINUX_NETFILTER */ + +/* + * Do we have unix sockets? (required for the winbind ntlm helper + */ +/* #undef HAVE_UNIXSOCKET */ + +/* + * Known-size integers + */ + +#define int16_t short + +#define u_int16_t unsigned short + +#define int32_t int + +#define u_int32_t unsigned int + +#define int64_t __int64 + +#define u_int64_t unsigned __int64 + +/* The number of bytes in a __int64. */ +#define SIZEOF___INT64 8 + +/* The number of bytes in a int16_t. */ +#define SIZEOF_INT16_T 2 + +/* The number of bytes in a int32_t. */ +#define SIZEOF_INT32_T 4 + +/* The number of bytes in a int64_t. */ +#define SIZEOF_INT64_T 8 + +/* The number of bytes in a off_t. */ +#define SIZEOF_OFF_T 4 + +/* The number of bytes in a size_t. */ +#define SIZEOF_SIZE_T 4 + +/* The number of bytes in a u_int16_t. */ +#define SIZEOF_U_INT16_T 2 + +/* The number of bytes in a u_int32_t. */ +#define SIZEOF_U_INT32_T 4 + +/* The number of bytes in a u_int64_t. */ +#define SIZEOF_U_INT64_T 8 + +/* The number of bytes in a uint16_t. */ +#define SIZEOF_UINT16_T 2 + +/* The number of bytes in a uint32_t. */ +#define SIZEOF_UINT32_T 4 + +/* The number of bytes in a uint64_t. */ +#define SIZEOF_UINT64_T 8 + +/* + * Enable support for the X-Accelerator-Vary HTTP header + */ +/* #undef X_ACCELERATOR_VARY */ + + +/* Enable hostname sanity checks */ +#define CHECK_HOSTNAMES 1 + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_NAMESER_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `backtrace_symbols_fd' function. */ +/* #undef HAVE_BACKTRACE_SYMBOLS_FD */ + +/* Define to 1 if you have the `bcopy' function. */ +/* #undef HAVE_BCOPY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSTRING_H */ + +/* Define to 1 if you have the `bswap_16' function. */ +/* #undef HAVE_BSWAP_16 */ + +/* Define to 1 if you have the `bswap_32' function. */ +/* #undef HAVE_BSWAP_32 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the `crypt' function. */ +#define HAVE_CRYPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CRYPT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the `drand48' function. */ +/* #undef HAVE_DRAND48 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `fchmod' function. */ +/* #undef HAVE_FCHMOD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getdtablesize' function. */ +/* #undef HAVE_GETDTABLESIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getpass' function. */ +/* #undef HAVE_GETPASS */ + +/* Define to 1 if you have the `getrlimit' function. */ +/* #undef HAVE_GETRLIMIT */ + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `getspnam' function. */ +/* #undef HAVE_GETSPNAM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GLIB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GNUMALLOC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GRP_H */ + +/* Define to 1 if you have the `initgroups' function. */ +/* #undef HAVE_INITGROUPS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_FIL_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_FIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IP_NAT_H */ + +/* Define to 1 if you have the `44bsd' library (-l44bsd). */ +/* #undef HAVE_LIB44BSD */ + +/* Define to 1 if you have the `bind' library (-lbind). */ +/* #undef HAVE_LIBBIND */ + +/* Define to 1 if you have the `bsd' library (-lbsd). */ +/* #undef HAVE_LIBBSD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBC_H */ + +/* Define to 1 if you have the `dl' library (-ldl). */ +/* #undef HAVE_LIBDL */ + +/* Define to 1 if you have the `gnumalloc' library (-lgnumalloc). */ +/* #undef HAVE_LIBGNUMALLOC */ + +/* Define to 1 if you have the `intl' library (-lintl). */ +/* #undef HAVE_LIBINTL */ + +/* Define to 1 if you have the `m' library (-lm). */ +/* #undef HAVE_LIBM */ + +/* Define to 1 if you have the `malloc' library (-lmalloc). */ +/* #undef HAVE_LIBMALLOC */ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* #undef HAVE_LIBPTHREAD */ + +/* Define to 1 if you have the `resolv' library (-lresolv). */ +/* #undef HAVE_LIBRESOLV */ + +/* Define to 1 if you have the `rt' library (-lrt). */ +/* #undef HAVE_LIBRT */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_NETFILTER_IPV4_H */ + +/* Define to 1 if you have the `lrand48' function. */ +/* #undef HAVE_LRAND48 */ + +/* Define to 1 if you have the `mallinfo' function. */ +/* #undef HAVE_MALLINFO */ + +/* Define to 1 if you have the `mallocblksize' function. */ +/* #undef HAVE_MALLOCBLKSIZE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MALLOC_H */ + +/* Define to 1 if you have the `mallopt' function. */ +/* #undef HAVE_MALLOPT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `mkstemp' function. */ +/* #undef HAVE_MKSTEMP */ + +/* Define to 1 if you have the `mktime' function. */ +#define HAVE_MKTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MOUNT_H */ + +/* Define to 1 if you have the `mstats' function. */ +/* #undef HAVE_MSTATS */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IF_ETHER_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_FIL_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_FIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IP_NAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_PFVAR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_COMMON_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_ERR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_MD5_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_SSL_H 1 + +/* Define to 1 if you have the `poll' function. */ +/* #undef HAVE_POLL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_POLL_H */ + +/* Define to 1 if you have the `pthread_attr_setschedparam' function. */ +/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ + +/* Define to 1 if you have the `pthread_attr_setscope' function. */ +/* #undef HAVE_PTHREAD_ATTR_SETSCOPE */ + +/* Define to 1 if you have the `pthread_setschedparam' function. */ +/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ + +/* Define to 1 if you have the `pthread_sigmask' function. */ +/* #undef HAVE_PTHREAD_SIGMASK */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PWD_H */ + +/* Define to 1 if you have the `random' function. */ +/* #undef HAVE_RANDOM */ + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the `regexec' function. */ +#define HAVE_REGEXEC 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define to 1 if you have the `regfree' function. */ +#define HAVE_REGFREE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_RESOLV_H */ + +/* Define to 1 if you have the `res_init' function. */ +/* #undef HAVE_RES_INIT */ + +/* Define to 1 if you have the `rint' function. */ +/* #undef HAVE_RINT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SASL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SASL_SASL_H */ + +/* Define to 1 if you have the `sbrk' function. */ +/* #undef HAVE_SBRK */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Define to 1 if you have the `seteuid' function. */ +/* #undef HAVE_SETEUID */ + +/* Define to 1 if you have the `setgroups' function. */ +/* #undef HAVE_SETGROUPS */ + +/* Define to 1 if you have the `setpgrp' function. */ +/* #undef HAVE_SETPGRP */ + +/* Define to 1 if you have the `setrlimit' function. */ +/* #undef HAVE_SETRLIMIT */ + +/* Define to 1 if you have the `setsid' function. */ +/* #undef HAVE_SETSID */ + +/* Define to 1 if you have the `sigaction' function. */ +/* #undef HAVE_SIGACTION */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `srand48' function. */ +/* #undef HAVE_SRAND48 */ + +/* Define to 1 if you have the `srandom' function. */ +/* #undef HAVE_SRANDOM */ + +/* Define to 1 if you have the `statfs' function. */ +#define HAVE_STATFS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSCALL_H */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the `syslog' function. */ +/* #undef HAVE_SYSLOG */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSLOG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BITYPES_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IOCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MSG_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_RESOURCE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STATVFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VFS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define to 1 if you have the `tempnam' function. */ +#define HAVE_TEMPNAM 1 + +/* Define to 1 if you have the `timegm' function. */ +/* #undef HAVE_TIMEGM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_VARARGS_H 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Support large cache files > 2GB */ +#define LARGE_CACHE_FILES 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "squid" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of a `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of a `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of a `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if does not define. */ +/* #undef fd_mask */ + +/* Define to `int' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +#define pid_t int + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#if DELAY_POOLS +#define STR_DELAY_POOLS "--enable-delay-pools " +#else +#define STR_DELAY_POOLS "" +#endif +#if USE_ICMP +#define STR_USE_ICMP "--enable-icmp " +#else +#define STR_USE_ICMP "" +#endif +#if USE_DNSSERVERS +#define STR_USE_DNSSERVERS "--disable-internal-dns " +#else +#define STR_USE_DNSSERVERS "" +#endif +#if USE_SSL +#define STR_USE_SSL "--enable-ssl " +#else +#define STR_USE_SSL "" +#endif +#if USE_CARP +#define STR_USE_CARP "--enable-carp " +#else +#define STR_USE_CARP "" +#endif +#if USE_ARP_ACL +#define STR_USE_ARP_ACL "--enable-arp-acl " +#else +#define STR_USE_ARP_ACL "" +#endif + +#define SQUID_CONFIGURE_OPTIONS "--enable-win32-service --enable-underscores --enable-storeio='ufs awin32 null' " \ + "--enable-removal-policies='heap lru' --enable-snmp --enable-htcp --disable-wccp --enable-useragent-log " \ + "--enable-referer-log --enable-auth='basic ntlm digest' --enable-basic-auth-helpers='LDAP ncsa_auth win32_locallogon' " \ + "--enable-ntlm-auth-helpers=NTLMSSP-WIN32 --enable-external-acl-helpers='win32_group ldap_group' --enable-large-cache-files "\ + STR_DELAY_POOLS \ + STR_USE_ICMP \ + STR_USE_DNSSERVERS \ + STR_USE_SSL \ + STR_USE_CARP \ + STR_USE_ARP_ACL \ + "--prefix=c:/squid" + +#endif /* __CONFIGURE_H__ */ Index: squid/port/win32/include/cdefs.h diff -u /dev/null squid/port/win32/include/cdefs.h:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/cdefs.h Sun Oct 27 02:48:32 2002 @@ -0,0 +1,22 @@ +/* sys/cdefs.h + + Copyright 1998, 2000, 2001 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H +#ifdef __cplusplus +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif +#define __P(protos) protos /* full-blown ANSI C */ +#endif + Index: squid/port/win32/include/crypt.h diff -u /dev/null squid/port/win32/include/crypt.h:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/crypt.h Sun Jul 14 14:07:29 2002 @@ -0,0 +1,45 @@ +/* encrypt.h - API to 56 bit DES encryption via calls + encrypt(3), setkey(3) and crypt(3) + Copyright (C) 1991 Jochen Obalek + + 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _ENCRYPT_H_ +#define _ENCRYPT_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#ifdef WIN32 +void encrypt(char *block, int edflag); +void setkey(char *key); +char * crypt(const char *key, const char *salt); + +#else +#include <_ansi.h> + +void _EXFUN(encrypt, (char *block, int edflag)); +void _EXFUN(setkey, (char *key)); +char * _EXFUN(crypt, (const char *key, const char *salt)); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _ENCRYPT_H_ */ Index: squid/port/win32/include/getopt.h diff -u /dev/null squid/port/win32/include/getopt.h:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/getopt.h Sun Oct 27 02:48:32 2002 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1987, 1993, 1994, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __GETOPT_H__ +#define __GETOPT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int opterr; /* if error message should be printed */ +extern int optind; /* index into parent argv vector */ +extern int optopt; /* character checked for validity */ +extern int optreset; /* reset getopt */ +extern char *optarg; /* argument associated with option */ + +int getopt (int, char * const *, const char *); + +#ifdef __cplusplus +} +#endif + +#endif /* __GETOPT_H__ */ + +#ifndef __UNISTD_GETOPT__ +#ifndef __GETOPT_LONG_H__ +#define __GETOPT_LONG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; + +int getopt_long (int, char *const *, const char *, const struct option *, int *); +#ifndef HAVE_DECL_GETOPT +#define HAVE_DECL_GETOPT 1 +#endif + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#ifdef __cplusplus +} +#endif + +#endif /* __GETOPT_LONG_H__ */ +#endif /* __UNISTD_GETOPT__ */ Index: squid/port/win32/include/squid-mswin.h diff -u /dev/null squid/port/win32/include/squid-mswin.h:1.1.2.34 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/include/squid-mswin.h Sat May 13 05:35:55 2006 @@ -0,0 +1,436 @@ +/* + * $Id$ + * + * AUTHOR: Guido Serassio & Andrey Shorin + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please 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. + * + */ + +#ifndef STDC_HEADERS +#define STDC_HEADERS 1 +#endif + +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 +# define __USE_FILE_OFFSET64 1 +#endif + +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ + +typedef char int8_t; +typedef unsigned char u_char; +typedef unsigned char uint8_t; +typedef unsigned char u_int8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned __int64 uint64_t; + +typedef int SOCKET; +typedef int ssize_t; +typedef int mode_t; + +#if defined __USE_FILE_OFFSET64 +typedef int64_t off_t; +typedef uint64_t ino_t; + +#else +typedef long off_t; +typedef unsigned long ino_t; + +#endif + +#define INT64_MAX _I64_MAX +#define INT64_MIN _I64_MIN +#define PRId64 "I64d" + +#include "default_config_file.h" +/* Some tricks for MS Compilers */ +#define __STDC__ 1 +#pragma include_alias(, ) +#define THREADLOCAL __declspec(thread) + +#elif defined(__GNUC__) /* gcc environment */ + +/* MinGW doesn't defines u_int8_t data type */ +typedef unsigned char u_int8_t; + +#define THREADLOCAL __attribute__((section(".tls"))) + +#endif + +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define alloca _alloca +#endif +#define chdir _chdir +#define dup _dup +#define dup2 _dup2 +#define fdopen _fdopen +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define fileno _fileno +#endif +#define ftruncate WIN32_ftruncate +#define getcwd _getcwd +#define getpid _getpid +#define getrusage WIN32_getrusage +#define ioctl ioctlsocket +#define memccpy _memccpy +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define mkdir(p) _mkdir(p) +#endif +#define mktemp _mktemp +#define open _open +#define pclose _pclose +#define pipe WIN32_pipe +#define popen _popen +#define putenv _putenv +#define setmode _setmode +#define sleep(t) Sleep((t)*1000) +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define snprintf _snprintf +#endif +#define strcasecmp _stricmp +#define strdup _strdup +#define strlwr _strlwr +#define strncasecmp _strnicmp +#define tempnam _tempnam +#define truncate WIN32_truncate +#define umask _umask +#define unlink _unlink +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define vsnprintf _vsnprintf +#endif + +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_APPEND _O_APPEND + +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_EXCL _O_EXCL + +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY +#define O_RAW _O_BINARY +#define O_TEMPORARY _O_TEMPORARY +#define O_NOINHERIT _O_NOINHERIT +#define O_SEQUENTIAL _O_SEQUENTIAL +#define O_RANDOM _O_RANDOM +#define O_NDELAY 0 + +#define S_IRWXO 007 +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) +#endif + +#ifndef SIGHUP +#define SIGHUP 1 /* hangup */ +#endif +#ifndef SIGBUS +#define SIGBUS 7 /* bus error */ +#endif +#ifndef SIGKILL +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#endif +#ifndef SIGSEGV +#define SIGSEGV 11 /* segment violation */ +#endif +#ifndef SIGPIPE +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#endif +#ifndef SIGCHLD +#define SIGCHLD 20 /* to parent on child stop or exit */ +#endif +#ifndef SIGUSR1 +#define SIGUSR1 30 /* user defined signal 1 */ +#endif +#ifndef SIGUSR2 +#define SIGUSR2 31 /* user defined signal 2 */ +#endif + +typedef unsigned short int ushort; +typedef int uid_t; +typedef int gid_t; + +#if defined __USE_FILE_OFFSET64 +#define stat _stati64 +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define lseek _lseeki64 +#endif +#define fstat _fstati64 +#define tell _telli64 + +#else +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define stat _stat +#define lseek _lseek +#define fstat _fstat +#define tell _tell +#endif + +#endif + +struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* user password */ + uid_t pw_uid; /* user id */ + gid_t pw_gid; /* group id */ + char *pw_gecos; /* real name */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell program */ +}; + +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ +}; + +struct statfs { + long f_type; /* type of filesystem (see below) */ + long f_bsize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + long f_fsid; /* file system id */ + long f_namelen; /* maximum length of filenames */ + long f_spare[6]; /* spare for later */ +}; + +struct timezone + { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ + }; + +#define CHANGE_FD_SETSIZE 1 +#if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE +#define FD_SETSIZE SQUID_MAXFD +#endif + +#include +#include +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +/* Hack to suppress compiler warnings on FD_SET() & FD_CLR() */ +#pragma warning (push) +#pragma warning (disable:4142) +#endif +/* prevent inclusion of wingdi.h */ +#define NOGDI +#include +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#pragma warning (pop) +#endif +#include "readdir.h" + +typedef char * caddr_t; + +#undef FD_CLOSE +#undef FD_OPEN +#undef FD_READ +#undef FD_WRITE +#define EISCONN WSAEISCONN +#define EINPROGRESS WSAEINPROGRESS +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EALREADY WSAEALREADY +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ECONNRESET WSAECONNRESET +#define ERESTART WSATRY_AGAIN + +#undef h_errno +#define h_errno errno /* we'll set it ourselves */ + +#undef FD_CLR +#define FD_CLR(fd, set) do { \ + u_int __i; \ + SOCKET __sock = _get_osfhandle(fd); \ + for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ + if (((fd_set FAR *)(set))->fd_array[__i] == __sock) { \ + while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ + ((fd_set FAR *)(set))->fd_array[__i] = \ + ((fd_set FAR *)(set))->fd_array[__i+1]; \ + __i++; \ + } \ + ((fd_set FAR *)(set))->fd_count--; \ + break; \ + } \ + } \ +} while(0) + +#undef FD_SET +#define FD_SET(fd, set) do { \ + u_int __i; \ + SOCKET __sock = _get_osfhandle(fd); \ + for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ + if (((fd_set FAR *)(set))->fd_array[__i] == (__sock)) { \ + break; \ + } \ + } \ + if (__i == ((fd_set FAR *)(set))->fd_count) { \ + if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \ + ((fd_set FAR *)(set))->fd_array[__i] = (__sock); \ + ((fd_set FAR *)(set))->fd_count++; \ + } \ + } \ +} while(0) + +#undef FD_ISSET +#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(_get_osfhandle(fd)), (fd_set FAR *)(set)) + +extern THREADLOCAL int ws32_result; + +#define strerror(e) WIN32_strerror(e) + +#define socket(f,t,p) \ + (INVALID_SOCKET == ((SOCKET)(ws32_result = (int)socket(f,t,p))) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#define accept(s,a,l) \ + (INVALID_SOCKET == ((SOCKET)(ws32_result = (int)accept(_get_osfhandle(s),a,l))) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#define bind(s,n,l) \ + (SOCKET_ERROR == bind(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define connect(s,n,l) \ + (SOCKET_ERROR == connect(_get_osfhandle(s),n,l) ? \ + (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) +#define listen(s,b) \ + (SOCKET_ERROR == listen(_get_osfhandle(s),b) ? \ + (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) +#define shutdown(s,h) \ + (SOCKET_ERROR == shutdown(_get_osfhandle(s),h) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define select(n,r,w,e,t) \ + (SOCKET_ERROR == (ws32_result = select(n,r,w,e,t)) ? \ + (errno = WSAGetLastError()), -1 : ws32_result) +#define recv(s,b,l,f) \ + (SOCKET_ERROR == (ws32_result = recv(_get_osfhandle(s),b,l,f)) ? \ + (errno = WSAGetLastError()), -1 : ws32_result) +#define recvfrom(s,b,l,f,fr,frl) \ + (SOCKET_ERROR == (ws32_result = recvfrom(_get_osfhandle(s),b,l,f,fr,frl)) ? \ + (errno = WSAGetLastError()), -1 : ws32_result) +#define send(s,b,l,f) \ + (SOCKET_ERROR == (ws32_result = send(_get_osfhandle(s),b,l,f)) ? \ + (errno = WSAGetLastError()), -1 : ws32_result) +#define sendto(s,b,l,f,t,tl) \ + (SOCKET_ERROR == (ws32_result = sendto(_get_osfhandle(s),b,l,f,t,tl)) ? \ + (errno = WSAGetLastError()), -1 : ws32_result) +#define getsockname(s,n,l) \ + (SOCKET_ERROR == getsockname(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define getsockopt(s,l,o,v,n) \ + (Sleep(1), SOCKET_ERROR == getsockopt(_get_osfhandle(s),l,o,(char*)v,n) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define setsockopt(s,l,o,v,n) \ + (SOCKET_ERROR == setsockopt(_get_osfhandle(s),l,o,v,n) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define ioctlsocket(s,c,a) \ + (SOCKET_ERROR == ioctlsocket(_get_osfhandle(s),c,a) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define gethostname(n,l) \ + (SOCKET_ERROR == gethostname(n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define gethostbyname(n) \ + (NULL == ((HOSTENT FAR*)(ws32_result = (int)gethostbyname(n))) ? \ + (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) +#define getservbyname(n,p) \ + (NULL == ((SERVENT FAR*)(ws32_result = (int)getservbyname(n,p))) ? \ + (errno = WSAGetLastError()), NULL : (SERVENT FAR*)ws32_result) +#define gethostbyaddr(a,l,t) \ + (NULL == ((HOSTENT FAR*)(ws32_result = (int)gethostbyaddr(a,l,t))) ? \ + (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) +#undef WSASocket +#ifdef UNICODE +#define WSASocket(a,t,p,i,g,f) \ + (INVALID_SOCKET == ((SOCKET)(ws32_result = (int)WSASocketW(a,t,p,i,g,f))) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#else +#define WSASocket(a,t,p,i,g,f) \ + (INVALID_SOCKET == ((SOCKET)(ws32_result = (int)WSASocketA(a,t,p,i,g,f))) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#endif /* !UNICODE */ +#undef WSADuplicateSocket +#ifdef UNICODE +#define WSADuplicateSocket(s,n,l) \ + (SOCKET_ERROR == WSADuplicateSocketW(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#else +#define WSADuplicateSocket(s,n,l) \ + (SOCKET_ERROR == WSADuplicateSocketA(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#endif /* !UNICODE */ + +#if defined(UTIL_C) +#define read _read +#define write _write +#else +extern THREADLOCAL int _so_err; +extern THREADLOCAL int _so_err_siz; +#define read(fd,buf,siz) \ + (_so_err_siz = sizeof(_so_err), \ + getsockopt((fd),SOL_SOCKET,SO_ERROR,&_so_err,&_so_err_siz) \ + == 0 ? recv((fd),(buf),(siz),0) : _read((fd),(buf),(siz))) +#define write(fd,buf,siz) \ + (_so_err_siz = sizeof(_so_err), \ + getsockopt((fd),SOL_SOCKET,SO_ERROR,&_so_err,&_so_err_siz) \ + == 0 ? send((fd),(buf),(siz),0) : _write((fd),(buf),(siz))) +#endif + +#if defined(COMM_C) || defined(TOOLS_C) +#define close WIN32_Close_FD_Socket +#else +#define close _close +#endif + +#define RUSAGE_SELF 0 /* calling process */ +#define RUSAGE_CHILDREN -1 /* terminated child processes */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* integral max resident set size */ + long ru_ixrss; /* integral shared text memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary context switches */ +}; Index: squid/port/win32/ip_user_check/.cvsignore diff -u /dev/null squid/port/win32/ip_user_check/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/ip_user_check/.cvsignore Sun Dec 1 01:32:50 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/ip_user_check/ip_user_check.dsp diff -u /dev/null squid/port/win32/ip_user_check/ip_user_check.dsp:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/ip_user_check/ip_user_check.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,114 @@ +# Microsoft Developer Studio Project File - Name="ip_user_check" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ip_user_check - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ip_user_check.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ip_user_check.mak" CFG="ip_user_check - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ip_user_check - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ip_user_check - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ip_user_check - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ip_user_check - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MT /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "ip_user_check - Win32 Release" +# Name "ip_user_check - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\ip_user\dict.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\ip_user\main.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\ip_user\match.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\ip_user\ip_user.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/libawin32/.cvsignore diff -u /dev/null squid/port/win32/libawin32/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libawin32/.cvsignore Mon Apr 8 12:27:23 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libawin32/libawin32.dsp diff -u /dev/null squid/port/win32/libawin32/libawin32.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libawin32/libawin32.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,112 @@ +# Microsoft Developer Studio Project File - Name="libawin32" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libawin32 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libawin32.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libawin32.mak" CFG="libawin32 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libawin32 - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libawin32 - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libawin32 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libawin32 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libawin32 - Win32 Release" +# Name "libawin32 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\fs\awin32\aiops.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fs\awin32\async_io.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fs\awin32\store_dir_aufs.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fs\awin32\store_io_aufs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\fs\awin32\store_asyncufs.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libbasic/.cvsignore diff -u /dev/null squid/port/win32/libbasic/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libbasic/.cvsignore Mon Apr 8 12:27:24 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libbasic/libbasic.dsp diff -u /dev/null squid/port/win32/libbasic/libbasic.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libbasic/libbasic.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="libbasic" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libbasic - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libbasic.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libbasic.mak" CFG="libbasic - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libbasic - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libbasic - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libbasic - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libbasic - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libbasic - Win32 Release" +# Name "libbasic - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\auth\basic\auth_basic.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\auth\basic\auth_basic.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libdigest/.cvsignore diff -u /dev/null squid/port/win32/libdigest/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libdigest/.cvsignore Sun May 5 09:47:20 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libdigest/libdigest.dsp diff -u /dev/null squid/port/win32/libdigest/libdigest.dsp:1.1.4.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libdigest/libdigest.dsp Fri Apr 22 12:08:53 2005 @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="libdigest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libdigest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libdigest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libdigest.mak" CFG="libdigest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libdigest - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libdigest - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libdigest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libdigest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libdigest - Win32 Release" +# Name "libdigest - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\auth\digest\auth_digest.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\auth\digest\auth_digest.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libgnuregex/.cvsignore diff -u /dev/null squid/port/win32/libgnuregex/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libgnuregex/.cvsignore Mon Apr 8 12:27:24 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libgnuregex/libgnuregex.dsp diff -u /dev/null squid/port/win32/libgnuregex/libgnuregex.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libgnuregex/libgnuregex.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="libgnuregex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libgnuregex - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libgnuregex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libgnuregex.mak" CFG="libgnuregex - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libgnuregex - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libgnuregex - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libgnuregex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libgnuregex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libgnuregex - Win32 Release" +# Name "libgnuregex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\lib\GNUregex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# End Target +# End Project Index: squid/port/win32/libheap/.cvsignore diff -u /dev/null squid/port/win32/libheap/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libheap/.cvsignore Mon Apr 8 12:27:24 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libheap/libheap.dsp diff -u /dev/null squid/port/win32/libheap/libheap.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libheap/libheap.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,104 @@ +# Microsoft Developer Studio Project File - Name="libheap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libheap - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libheap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libheap.mak" CFG="libheap - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libheap - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libheap - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libheap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libheap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libheap - Win32 Release" +# Name "libheap - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\repl\heap\store_heap_replacement.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\repl\heap\store_repl_heap.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\repl\heap\store_heap_replacement.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/liblru/.cvsignore diff -u /dev/null squid/port/win32/liblru/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/liblru/.cvsignore Mon Apr 8 12:31:19 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/liblru/liblru.dsp diff -u /dev/null squid/port/win32/liblru/liblru.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/liblru/liblru.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="liblru" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=liblru - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "liblru.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "liblru.mak" CFG="liblru - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "liblru - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "liblru - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "liblru - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "liblru - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "liblru - Win32 Release" +# Name "liblru - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\repl\lru\store_repl_lru.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# End Target +# End Project Index: squid/port/win32/libmiscutil/.cvsignore diff -u /dev/null squid/port/win32/libmiscutil/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libmiscutil/.cvsignore Mon Apr 8 12:31:20 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libmiscutil/libmiscutil.dsp diff -u /dev/null squid/port/win32/libmiscutil/libmiscutil.dsp:1.1.2.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libmiscutil/libmiscutil.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,216 @@ +# Microsoft Developer Studio Project File - Name="libmiscutil" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libmiscutil - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmiscutil.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmiscutil.mak" CFG="libmiscutil - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmiscutil - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libmiscutil - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libmiscutil - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../include" /I "../../../src" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libmiscutil - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../include" /I "../../../src" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libmiscutil - Win32 Release" +# Name "libmiscutil - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\lib\Array.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\base64.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\drand48.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\getfullhostname.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\hash.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\heap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\html_quote.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\initgroups.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\iso3307.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\md5.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\radix.c +# End Source File +# Begin Source File + +SOURCE=..\src\readdir.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\rfc1035.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\rfc1123.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\rfc1738.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\rfc2617.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\safe_inet_addr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\snprintf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\splay.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\Stack.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\stub_memaccount.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\util.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\uudecode.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\lib\win32lib.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\heap.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\md5.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\parse.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\radix.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snprintf.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\util.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libntlm/.cvsignore diff -u /dev/null squid/port/win32/libntlm/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libntlm/.cvsignore Mon Apr 8 12:21:04 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libntlm/libntlm.dsp diff -u /dev/null squid/port/win32/libntlm/libntlm.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libntlm/libntlm.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="libntlm" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libntlm - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libntlm.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libntlm.mak" CFG="libntlm - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libntlm - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libntlm - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libntlm - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libntlm - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libntlm - Win32 Release" +# Name "libntlm - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\auth\ntlm\auth_ntlm.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\auth\ntlm\auth_ntlm.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libntlmauth/.cvsignore diff -u /dev/null squid/port/win32/libntlmauth/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libntlmauth/.cvsignore Mon Apr 8 12:21:04 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libntlmauth/libntlmauth.dsp diff -u /dev/null squid/port/win32/libntlmauth/libntlmauth.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libntlmauth/libntlmauth.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="libntlmauth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libntlmauth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libntlmauth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libntlmauth.mak" CFG="libntlmauth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libntlmauth - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libntlmauth - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libntlmauth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libntlmauth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libntlmauth - Win32 Release" +# Name "libntlmauth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\lib\ntlmauth.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\ntlmauth.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libnull/.cvsignore diff -u /dev/null squid/port/win32/libnull/.cvsignore:1.1.4.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libnull/.cvsignore Sun May 5 09:47:20 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libnull/libnull.dsp diff -u /dev/null squid/port/win32/libnull/libnull.dsp:1.1.4.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libnull/libnull.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="libnull" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libnull - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libnull.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libnull.mak" CFG="libnull - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libnull - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libnull - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libnull - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libnull - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libnull - Win32 Release" +# Name "libnull - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\fs\null\store_null.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# End Target +# End Project Index: squid/port/win32/libsnmp/.cvsignore diff -u /dev/null squid/port/win32/libsnmp/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libsnmp/.cvsignore Mon Apr 8 12:21:05 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libsnmp/libsnmp.dsp diff -u /dev/null squid/port/win32/libsnmp/libsnmp.dsp:1.1.2.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libsnmp/libsnmp.dsp Fri Apr 22 12:08:54 2005 @@ -0,0 +1,204 @@ +# Microsoft Developer Studio Project File - Name="libsnmp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libsnmp - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsnmp.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsnmp.mak" CFG="libsnmp - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsnmp - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libsnmp - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsnmp - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D SQUID_SNMP=1 /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libsnmp - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D SQUID_SNMP=1 /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libsnmp - Win32 Release" +# Name "libsnmp - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\snmplib\asn1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\coexistance.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\mib.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\parse.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_api.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_api_error.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_error.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_msg.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_pdu.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmp_vars.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\snmplib\snmplib_debug.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE="..\..\..\include\snmp-internal.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\include\snmp-mib.h" +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_api.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_api_error.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_api_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_client.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_coexist.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_compat.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_debug.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_error.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_impl.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_msg.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_pdu.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_session.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\snmp_vars.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libsspwin32/.cvsignore diff -u /dev/null squid/port/win32/libsspwin32/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libsspwin32/.cvsignore Tue Jul 16 06:00:48 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libsspwin32/libsspwin32.dsp diff -u /dev/null squid/port/win32/libsspwin32/libsspwin32.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libsspwin32/libsspwin32.dsp Fri Apr 22 12:08:55 2005 @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="libsspwin32" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libsspwin32 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsspwin32.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsspwin32.mak" CFG="libsspwin32 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsspwin32 - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libsspwin32 - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsspwin32 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libsspwin32 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libsspwin32 - Win32 Release" +# Name "libsspwin32 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\lib\sspwin32.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\sspwin32.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/libufs/.cvsignore diff -u /dev/null squid/port/win32/libufs/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libufs/.cvsignore Mon Apr 8 12:21:05 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/libufs/libufs.dsp diff -u /dev/null squid/port/win32/libufs/libufs.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/libufs/libufs.dsp Fri Apr 22 12:08:55 2005 @@ -0,0 +1,104 @@ +# Microsoft Developer Studio Project File - Name="libufs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libufs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libufs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libufs.mak" CFG="libufs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libufs - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libufs - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libufs - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libufs - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libufs - Win32 Release" +# Name "libufs - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\fs\ufs\store_dir_ufs.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fs\ufs\store_io_ufs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\fs\ufs\store_ufs.h +# End Source File +# End Group +# End Target +# End Project Index: squid/port/win32/nt_auth/.cvsignore diff -u /dev/null squid/port/win32/nt_auth/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/nt_auth/.cvsignore Mon Apr 8 12:21:05 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/nt_auth/nt_auth.dsp diff -u /dev/null squid/port/win32/nt_auth/nt_auth.dsp:1.1.2.8 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/nt_auth/nt_auth.dsp Fri Apr 22 12:08:55 2005 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="nt_auth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=nt_auth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "nt_auth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "nt_auth.mak" CFG="nt_auth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "nt_auth - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "nt_auth - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "nt_auth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 advapi32.lib netapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "nt_auth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 advapi32.lib netapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "nt_auth - Win32 Release" +# Name "nt_auth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\basic_auth\win32_locallogon\NT_auth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\helpers\basic_auth\win32_locallogon\valid.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\helpers\basic_auth\win32_locallogon\valid.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/ntlm_win32_auth/.cvsignore diff -u /dev/null squid/port/win32/ntlm_win32_auth/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/ntlm_win32_auth/.cvsignore Sun Apr 21 13:37:34 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/ntlm_win32_auth/ntlm_win32_auth.dsp diff -u /dev/null squid/port/win32/ntlm_win32_auth/ntlm_win32_auth.dsp:1.1.2.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/ntlm_win32_auth/ntlm_win32_auth.dsp Fri Apr 22 12:08:55 2005 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="ntlm_win32_auth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ntlm_win32_auth - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ntlm_win32_auth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ntlm_win32_auth.mak" CFG="ntlm_win32_auth - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ntlm_win32_auth - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ntlm_win32_auth - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ntlm_win32_auth - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Netapi32.lib Advapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ntlm_win32_auth - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Netapi32.lib Advapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "ntlm_win32_auth - Win32 Release" +# Name "ntlm_win32_auth - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE="..\..\..\helpers\ntlm_auth\NTLMSSP-WIN32\libntlmssp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\..\helpers\ntlm_auth\NTLMSSP-WIN32\ntlm_auth.c" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE="..\..\..\helpers\ntlm_auth\NTLMSSP-WIN32\ntlm.h" +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/pinger/.cvsignore diff -u /dev/null squid/port/win32/pinger/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/pinger/.cvsignore Mon Apr 8 12:21:05 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/pinger/pinger.dsp diff -u /dev/null squid/port/win32/pinger/pinger.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/pinger/pinger.dsp Fri Apr 22 12:08:55 2005 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="pinger" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pinger - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pinger.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pinger.mak" CFG="pinger - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pinger - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pinger - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pinger - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D "PINGER" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "pinger - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D "PINGER" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pinger - Win32 Release" +# Name "pinger - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\debug.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\globals.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pinger.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/squid/.cvsignore diff -u /dev/null squid/port/win32/squid/.cvsignore:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/.cvsignore Sat Jun 29 03:42:05 2002 @@ -0,0 +1,4 @@ +.cvsignore +Debug +Release +buildver.h Index: squid/port/win32/squid/buildcount.dsm diff -u /dev/null squid/port/win32/squid/buildcount.dsm:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/buildcount.dsm Sat Jun 29 03:42:05 2002 @@ -0,0 +1,82 @@ +'------------------------------------------------------------------------------ +'FILE DESCRIPTION: Automatically increment the version resource information of the project after each build +'------------------------------------------------------------------------------ +Function GetProjectDir(FullName) + +'VC++ doesn't provide any method for getting the path of the active project +'See the VB Script reference for more information on the VB Script functions +'used in this function + +Dim proj_path +proj_path = Split(StrReverse(FullName),"\",-1,1) + +Dim count +count = UBound(proj_path) + +Dim full_path +full_path = "" +Dim i + +for i = 1 to count + full_path = full_path & "\" & proj_path(i) +next + +GetProjectDir = StrReverse(full_path) + +End Function + + +Sub ReplaceText(selection, count, incrementby) + +'selection represents the TextSelection object +'count represents the position of the version number to be incremented +'incrementby represents a number that will be added to the existing version number + +selection.WordRight dsMove, count +selection.WordRight dsExtend, 1 +Dim str +str = selection.Text +str = str + incrementby + +selection.Text = str + +End Sub + + +Sub Application_BuildFinish(numError, numWarning) + +'This event will be triggered after every build of a project +'You can check numError and/or numWarning to determine if you want to continue +'If numError <> 0 Then + 'exit sub +'Obtain the full path of the active project +Dim full_path +full_path = GetProjectDir(ActiveProject.FullName) + +full_path = full_path & "buildver.h" + +'Open the VersionNo.h file +on error resume next +Documents.Open full_path + +'Obtain the TextSelection object +Dim selection +set selection = ActiveDocument.Selection +selection.StartOfDocument + +'Increment the version information +ReplaceText selection, 9, 1 +selection.LineDown +selection.StartOfLine +ReplaceText selection, 9, 1 +selection.LineDown +selection.StartOfLine +ReplaceText selection, 10, 1 +selection.LineDown +selection.StartOfLine +ReplaceText selection, 10, 1 + +ActiveDocument.Save +ActiveDocument.Close + +End Sub \ No newline at end of file Index: squid/port/win32/squid/buildver.h diff -u /dev/null squid/port/win32/squid/buildver.h:1.1.2.21 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/buildver.h Thu Sep 25 08:52:21 2003 @@ -0,0 +1,4 @@ +#define FILEVER 2,5,4,0 +#define PRODUCTVER 2,5,4,0 +#define STRFILEVER "2, 5, 4, 0\0" +#define STRPRODUCTVER "2, 5, 4, 0\0" Index: squid/port/win32/squid/resource.h diff -u /dev/null squid/port/win32/squid/resource.h:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/resource.h Sun Jun 23 09:08:08 2002 @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by squid.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Index: squid/port/win32/squid/squid.dsp diff -u /dev/null squid/port/win32/squid/squid.dsp:1.1.2.13 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/squid.dsp Fri Apr 22 12:08:56 2005 @@ -0,0 +1,535 @@ +# Microsoft Developer Studio Project File - Name="squid" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=squid - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "squid.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "squid.mak" CFG="squid - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "squid - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "squid - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "squid - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /I "../../" /I "../include" /I "../../../include" /I "../../../src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib advapi32.lib psapi.lib Iphlpapi.lib libeay32.lib ssleay32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /I "../include" /I "../../../include" /I "../../../src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib advapi32.lib psapi.lib Iphlpapi.lib libeay32.lib ssleay32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "squid - Win32 Release" +# Name "squid - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\access_log.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\acl.c +# ADD CPP /D "AUTH_ON_ACCELERATION" +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\asn.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\auth_modules.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\authenticate.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cache_cf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cache_manager.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\CacheDigest.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\carp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cbdata.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\client_db.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\client_side.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\comm.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\comm_select.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\debug.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\delay_pools.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\disk.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\dns.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\dns_internal.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\errorpage.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ETag.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\event.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\external_acl.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fd.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\filemap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\forward.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\fqdncache.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ftp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\globals.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\gopher.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\helper.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\htcp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\http.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpBody.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpHdrCc.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpHdrContRange.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpHdrRange.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpHeader.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpHeaderTools.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpMsg.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpReply.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpRequest.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\HttpStatusLine.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\icmp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\icp_v2.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\icp_v3.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ident.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\internal.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ipc.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ipcache.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\leakfinder.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\logfile.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\main.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\mem.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\MemBuf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\MemPool.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\mime.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\multicast.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\neighbors.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\net_db.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\Packer.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pconn.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\peer_digest.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\peer_select.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\redirect.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\referer.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\refresh.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\repl_modules.c +# End Source File +# Begin Source File + +SOURCE="..\..\..\src\send-announce.c" +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\snmp_agent.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\snmp_core.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ssl.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\ssl_support.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\stat.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\StatHist.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\stmem.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_client.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_digest.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_dir.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_io.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_key_md5.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_log.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_modules.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_rebuild.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_swapin.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_swapmeta.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\store_swapout.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\String.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\string_arrays.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\tools.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\unlinkd.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\url.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\urn.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\useragent.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\wais.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\wccp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\whois.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\win32.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\src\defines.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\enums.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\protos.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\squid.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\structs.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\typedefs.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\buildver.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\squid.rc +# End Source File +# End Group +# Begin Source File + +SOURCE=.\buildcount.dsm +# End Source File +# End Target +# End Project Index: squid/port/win32/squid/squid.mak diff -u /dev/null squid/port/win32/squid/squid.mak:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/squid.mak Sat Mar 16 09:46:08 2002 @@ -0,0 +1,1325 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on squid.dsp +!IF "$(CFG)" == "" +CFG=squid - Win32 Debug +!MESSAGE No configuration specified. Defaulting to squid - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "squid - Win32 Release" && "$(CFG)" != "squid - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "squid.mak" CFG="squid - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "squid - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "squid - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "squid - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\squid.exe" + +!ELSE + +ALL : "squid_conf_default - Win32 Release" "modules - Win32 Release" "libsnmp - Win32 Release" "libntlmauth - Win32 Release" "PerlPreprocessing - Win32 Release" "libmiscutil - Win32 Release" "libgnuregex - Win32 Release" "$(OUTDIR)\squid.exe" + +!ENDIF + +!IF "$(RECURSE)" == "1" +CLEAN :"libgnuregex - Win32 ReleaseCLEAN" "libmiscutil - Win32 ReleaseCLEAN" "PerlPreprocessing - Win32 ReleaseCLEAN" "libntlmauth - Win32 ReleaseCLEAN" "libsnmp - Win32 ReleaseCLEAN" "modules - Win32 ReleaseCLEAN" "squid_conf_default - Win32 ReleaseCLEAN" +!ELSE +CLEAN : +!ENDIF + -@erase "$(INTDIR)\access_log.obj" + -@erase "$(INTDIR)\acl.obj" + -@erase "$(INTDIR)\asn.obj" + -@erase "$(INTDIR)\auth_modules.obj" + -@erase "$(INTDIR)\authenticate.obj" + -@erase "$(INTDIR)\cache_manager.obj" + -@erase "$(INTDIR)\CacheDigest.obj" + -@erase "$(INTDIR)\carp.obj" + -@erase "$(INTDIR)\cbdata.obj" + -@erase "$(INTDIR)\client_db.obj" + -@erase "$(INTDIR)\client_side.obj" + -@erase "$(INTDIR)\comm.obj" + -@erase "$(INTDIR)\comm_select.obj" + -@erase "$(INTDIR)\debug.obj" + -@erase "$(INTDIR)\delay_pools.obj" + -@erase "$(INTDIR)\disk.obj" + -@erase "$(INTDIR)\dns.obj" + -@erase "$(INTDIR)\dns_internal.obj" + -@erase "$(INTDIR)\errorpage.obj" + -@erase "$(INTDIR)\ETag.obj" + -@erase "$(INTDIR)\event.obj" + -@erase "$(INTDIR)\fd.obj" + -@erase "$(INTDIR)\filemap.obj" + -@erase "$(INTDIR)\forward.obj" + -@erase "$(INTDIR)\fqdncache.obj" + -@erase "$(INTDIR)\ftp.obj" + -@erase "$(INTDIR)\globals.obj" + -@erase "$(INTDIR)\gopher.obj" + -@erase "$(INTDIR)\helper.obj" + -@erase "$(INTDIR)\htcp.obj" + -@erase "$(INTDIR)\http.obj" + -@erase "$(INTDIR)\HttpBody.obj" + -@erase "$(INTDIR)\HttpHdrCc.obj" + -@erase "$(INTDIR)\HttpHdrContRange.obj" + -@erase "$(INTDIR)\HttpHdrExtField.obj" + -@erase "$(INTDIR)\HttpHdrRange.obj" + -@erase "$(INTDIR)\HttpHeader.obj" + -@erase "$(INTDIR)\HttpHeaderTools.obj" + -@erase "$(INTDIR)\HttpMsg.obj" + -@erase "$(INTDIR)\HttpReply.obj" + -@erase "$(INTDIR)\HttpRequest.obj" + -@erase "$(INTDIR)\HttpStatusLine.obj" + -@erase "$(INTDIR)\icmp.obj" + -@erase "$(INTDIR)\icp_v2.obj" + -@erase "$(INTDIR)\icp_v3.obj" + -@erase "$(INTDIR)\ident.obj" + -@erase "$(INTDIR)\internal.obj" + -@erase "$(INTDIR)\ipc.obj" + -@erase "$(INTDIR)\ipcache.obj" + -@erase "$(INTDIR)\leakfinder.obj" + -@erase "$(INTDIR)\logfile.obj" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\mem.obj" + -@erase "$(INTDIR)\MemBuf.obj" + -@erase "$(INTDIR)\MemPool.obj" + -@erase "$(INTDIR)\mime.obj" + -@erase "$(INTDIR)\multicast.obj" + -@erase "$(INTDIR)\neighbors.obj" + -@erase "$(INTDIR)\net_db.obj" + -@erase "$(INTDIR)\Packer.obj" + -@erase "$(INTDIR)\pconn.obj" + -@erase "$(INTDIR)\peer_digest.obj" + -@erase "$(INTDIR)\peer_select.obj" + -@erase "$(INTDIR)\redirect.obj" + -@erase "$(INTDIR)\referer.obj" + -@erase "$(INTDIR)\refresh.obj" + -@erase "$(INTDIR)\repl_modules.obj" + -@erase "$(INTDIR)\send-announce.obj" + -@erase "$(INTDIR)\snmp_agent.obj" + -@erase "$(INTDIR)\snmp_core.obj" + -@erase "$(INTDIR)\ssl.obj" + -@erase "$(INTDIR)\stat.obj" + -@erase "$(INTDIR)\StatHist.obj" + -@erase "$(INTDIR)\stmem.obj" + -@erase "$(INTDIR)\store.obj" + -@erase "$(INTDIR)\store_client.obj" + -@erase "$(INTDIR)\store_digest.obj" + -@erase "$(INTDIR)\store_dir.obj" + -@erase "$(INTDIR)\store_io.obj" + -@erase "$(INTDIR)\store_key_md5.obj" + -@erase "$(INTDIR)\store_log.obj" + -@erase "$(INTDIR)\store_modules.obj" + -@erase "$(INTDIR)\store_rebuild.obj" + -@erase "$(INTDIR)\store_swapin.obj" + -@erase "$(INTDIR)\store_swapmeta.obj" + -@erase "$(INTDIR)\store_swapout.obj" + -@erase "$(INTDIR)\String.obj" + -@erase "$(INTDIR)\string_arrays.obj" + -@erase "$(INTDIR)\test_cache_digest.obj" + -@erase "$(INTDIR)\tools.obj" + -@erase "$(INTDIR)\url.obj" + -@erase "$(INTDIR)\urn.obj" + -@erase "$(INTDIR)\useragent.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\wais.obj" + -@erase "$(INTDIR)\wccp.obj" + -@erase "$(INTDIR)\whois.obj" + -@erase "$(INTDIR)\win32.obj" + -@erase "$(OUTDIR)\squid.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /O2 /I "../../" /I "../include" /I "../../../include" /I "../../../src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D DEFAULT_CONFIG_FILE=\"squid.conf\" /Fp"$(INTDIR)\squid.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\squid.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=ws2_32.lib advapi32.lib psapi.lib iphlpapi.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\squid.pdb" /machine:I386 /out:"$(OUTDIR)\squid.exe" +LINK32_OBJS= \ + "$(INTDIR)\access_log.obj" \ + "$(INTDIR)\acl.obj" \ + "$(INTDIR)\asn.obj" \ + "$(INTDIR)\auth_modules.obj" \ + "$(INTDIR)\authenticate.obj" \ + "$(INTDIR)\cache_manager.obj" \ + "$(INTDIR)\CacheDigest.obj" \ + "$(INTDIR)\carp.obj" \ + "$(INTDIR)\cbdata.obj" \ + "$(INTDIR)\client_db.obj" \ + "$(INTDIR)\client_side.obj" \ + "$(INTDIR)\comm.obj" \ + "$(INTDIR)\comm_select.obj" \ + "$(INTDIR)\debug.obj" \ + "$(INTDIR)\delay_pools.obj" \ + "$(INTDIR)\disk.obj" \ + "$(INTDIR)\dns.obj" \ + "$(INTDIR)\dns_internal.obj" \ + "$(INTDIR)\errorpage.obj" \ + "$(INTDIR)\ETag.obj" \ + "$(INTDIR)\event.obj" \ + "$(INTDIR)\fd.obj" \ + "$(INTDIR)\filemap.obj" \ + "$(INTDIR)\forward.obj" \ + "$(INTDIR)\fqdncache.obj" \ + "$(INTDIR)\ftp.obj" \ + "$(INTDIR)\globals.obj" \ + "$(INTDIR)\gopher.obj" \ + "$(INTDIR)\helper.obj" \ + "$(INTDIR)\htcp.obj" \ + "$(INTDIR)\http.obj" \ + "$(INTDIR)\HttpBody.obj" \ + "$(INTDIR)\HttpHdrCc.obj" \ + "$(INTDIR)\HttpHdrContRange.obj" \ + "$(INTDIR)\HttpHdrExtField.obj" \ + "$(INTDIR)\HttpHdrRange.obj" \ + "$(INTDIR)\HttpHeader.obj" \ + "$(INTDIR)\HttpHeaderTools.obj" \ + "$(INTDIR)\HttpMsg.obj" \ + "$(INTDIR)\HttpReply.obj" \ + "$(INTDIR)\HttpRequest.obj" \ + "$(INTDIR)\HttpStatusLine.obj" \ + "$(INTDIR)\icmp.obj" \ + "$(INTDIR)\icp_v2.obj" \ + "$(INTDIR)\icp_v3.obj" \ + "$(INTDIR)\ident.obj" \ + "$(INTDIR)\internal.obj" \ + "$(INTDIR)\ipc.obj" \ + "$(INTDIR)\ipcache.obj" \ + "$(INTDIR)\leakfinder.obj" \ + "$(INTDIR)\logfile.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\mem.obj" \ + "$(INTDIR)\MemBuf.obj" \ + "$(INTDIR)\MemPool.obj" \ + "$(INTDIR)\mime.obj" \ + "$(INTDIR)\multicast.obj" \ + "$(INTDIR)\neighbors.obj" \ + "$(INTDIR)\net_db.obj" \ + "$(INTDIR)\Packer.obj" \ + "$(INTDIR)\pconn.obj" \ + "$(INTDIR)\peer_digest.obj" \ + "$(INTDIR)\peer_select.obj" \ + "$(INTDIR)\redirect.obj" \ + "$(INTDIR)\referer.obj" \ + "$(INTDIR)\refresh.obj" \ + "$(INTDIR)\repl_modules.obj" \ + "$(INTDIR)\send-announce.obj" \ + "$(INTDIR)\snmp_agent.obj" \ + "$(INTDIR)\snmp_core.obj" \ + "$(INTDIR)\ssl.obj" \ + "$(INTDIR)\stat.obj" \ + "$(INTDIR)\StatHist.obj" \ + "$(INTDIR)\stmem.obj" \ + "$(INTDIR)\store.obj" \ + "$(INTDIR)\store_client.obj" \ + "$(INTDIR)\store_digest.obj" \ + "$(INTDIR)\store_dir.obj" \ + "$(INTDIR)\store_io.obj" \ + "$(INTDIR)\store_key_md5.obj" \ + "$(INTDIR)\store_log.obj" \ + "$(INTDIR)\store_modules.obj" \ + "$(INTDIR)\store_rebuild.obj" \ + "$(INTDIR)\store_swapin.obj" \ + "$(INTDIR)\store_swapmeta.obj" \ + "$(INTDIR)\store_swapout.obj" \ + "$(INTDIR)\String.obj" \ + "$(INTDIR)\string_arrays.obj" \ + "$(INTDIR)\test_cache_digest.obj" \ + "$(INTDIR)\tools.obj" \ + "$(INTDIR)\url.obj" \ + "$(INTDIR)\urn.obj" \ + "$(INTDIR)\useragent.obj" \ + "$(INTDIR)\wais.obj" \ + "$(INTDIR)\wccp.obj" \ + "$(INTDIR)\whois.obj" \ + "$(INTDIR)\win32.obj" \ + "..\libgnuregex\Release\libgnuregex.lib" \ + "..\libmiscutil\Release\libmiscutil.lib" \ + "..\libntlmauth\Release\libntlmauth.lib" \ + "..\libsnmp\Release\libsnmp.lib" + +"$(OUTDIR)\squid.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\squid.exe" + +!ELSE + +ALL : "squid_conf_default - Win32 Debug" "modules - Win32 Debug" "libsnmp - Win32 Debug" "libntlmauth - Win32 Debug" "PerlPreprocessing - Win32 Debug" "libmiscutil - Win32 Debug" "libgnuregex - Win32 Debug" "$(OUTDIR)\squid.exe" + +!ENDIF + +!IF "$(RECURSE)" == "1" +CLEAN :"libgnuregex - Win32 DebugCLEAN" "libmiscutil - Win32 DebugCLEAN" "PerlPreprocessing - Win32 DebugCLEAN" "libntlmauth - Win32 DebugCLEAN" "libsnmp - Win32 DebugCLEAN" "modules - Win32 DebugCLEAN" "squid_conf_default - Win32 DebugCLEAN" +!ELSE +CLEAN : +!ENDIF + -@erase "$(INTDIR)\access_log.obj" + -@erase "$(INTDIR)\acl.obj" + -@erase "$(INTDIR)\asn.obj" + -@erase "$(INTDIR)\auth_modules.obj" + -@erase "$(INTDIR)\authenticate.obj" + -@erase "$(INTDIR)\cache_manager.obj" + -@erase "$(INTDIR)\CacheDigest.obj" + -@erase "$(INTDIR)\carp.obj" + -@erase "$(INTDIR)\cbdata.obj" + -@erase "$(INTDIR)\client_db.obj" + -@erase "$(INTDIR)\client_side.obj" + -@erase "$(INTDIR)\comm.obj" + -@erase "$(INTDIR)\comm_select.obj" + -@erase "$(INTDIR)\debug.obj" + -@erase "$(INTDIR)\delay_pools.obj" + -@erase "$(INTDIR)\disk.obj" + -@erase "$(INTDIR)\dns.obj" + -@erase "$(INTDIR)\dns_internal.obj" + -@erase "$(INTDIR)\errorpage.obj" + -@erase "$(INTDIR)\ETag.obj" + -@erase "$(INTDIR)\event.obj" + -@erase "$(INTDIR)\fd.obj" + -@erase "$(INTDIR)\filemap.obj" + -@erase "$(INTDIR)\forward.obj" + -@erase "$(INTDIR)\fqdncache.obj" + -@erase "$(INTDIR)\ftp.obj" + -@erase "$(INTDIR)\globals.obj" + -@erase "$(INTDIR)\gopher.obj" + -@erase "$(INTDIR)\helper.obj" + -@erase "$(INTDIR)\htcp.obj" + -@erase "$(INTDIR)\http.obj" + -@erase "$(INTDIR)\HttpBody.obj" + -@erase "$(INTDIR)\HttpHdrCc.obj" + -@erase "$(INTDIR)\HttpHdrContRange.obj" + -@erase "$(INTDIR)\HttpHdrExtField.obj" + -@erase "$(INTDIR)\HttpHdrRange.obj" + -@erase "$(INTDIR)\HttpHeader.obj" + -@erase "$(INTDIR)\HttpHeaderTools.obj" + -@erase "$(INTDIR)\HttpMsg.obj" + -@erase "$(INTDIR)\HttpReply.obj" + -@erase "$(INTDIR)\HttpRequest.obj" + -@erase "$(INTDIR)\HttpStatusLine.obj" + -@erase "$(INTDIR)\icmp.obj" + -@erase "$(INTDIR)\icp_v2.obj" + -@erase "$(INTDIR)\icp_v3.obj" + -@erase "$(INTDIR)\ident.obj" + -@erase "$(INTDIR)\internal.obj" + -@erase "$(INTDIR)\ipc.obj" + -@erase "$(INTDIR)\ipcache.obj" + -@erase "$(INTDIR)\leakfinder.obj" + -@erase "$(INTDIR)\logfile.obj" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\mem.obj" + -@erase "$(INTDIR)\MemBuf.obj" + -@erase "$(INTDIR)\MemPool.obj" + -@erase "$(INTDIR)\mime.obj" + -@erase "$(INTDIR)\multicast.obj" + -@erase "$(INTDIR)\neighbors.obj" + -@erase "$(INTDIR)\net_db.obj" + -@erase "$(INTDIR)\Packer.obj" + -@erase "$(INTDIR)\pconn.obj" + -@erase "$(INTDIR)\peer_digest.obj" + -@erase "$(INTDIR)\peer_select.obj" + -@erase "$(INTDIR)\redirect.obj" + -@erase "$(INTDIR)\referer.obj" + -@erase "$(INTDIR)\refresh.obj" + -@erase "$(INTDIR)\repl_modules.obj" + -@erase "$(INTDIR)\send-announce.obj" + -@erase "$(INTDIR)\snmp_agent.obj" + -@erase "$(INTDIR)\snmp_core.obj" + -@erase "$(INTDIR)\ssl.obj" + -@erase "$(INTDIR)\stat.obj" + -@erase "$(INTDIR)\StatHist.obj" + -@erase "$(INTDIR)\stmem.obj" + -@erase "$(INTDIR)\store.obj" + -@erase "$(INTDIR)\store_client.obj" + -@erase "$(INTDIR)\store_digest.obj" + -@erase "$(INTDIR)\store_dir.obj" + -@erase "$(INTDIR)\store_io.obj" + -@erase "$(INTDIR)\store_key_md5.obj" + -@erase "$(INTDIR)\store_log.obj" + -@erase "$(INTDIR)\store_modules.obj" + -@erase "$(INTDIR)\store_rebuild.obj" + -@erase "$(INTDIR)\store_swapin.obj" + -@erase "$(INTDIR)\store_swapmeta.obj" + -@erase "$(INTDIR)\store_swapout.obj" + -@erase "$(INTDIR)\String.obj" + -@erase "$(INTDIR)\string_arrays.obj" + -@erase "$(INTDIR)\test_cache_digest.obj" + -@erase "$(INTDIR)\tools.obj" + -@erase "$(INTDIR)\url.obj" + -@erase "$(INTDIR)\urn.obj" + -@erase "$(INTDIR)\useragent.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(INTDIR)\wais.obj" + -@erase "$(INTDIR)\wccp.obj" + -@erase "$(INTDIR)\whois.obj" + -@erase "$(INTDIR)\win32.obj" + -@erase "$(OUTDIR)\squid.exe" + -@erase "$(OUTDIR)\squid.ilk" + -@erase "$(OUTDIR)\squid.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /G6 /MLd /W3 /Gm /GX /ZI /Od /I "../include" /I "../../../include" /I "../../../src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D DEFAULT_CONFIG_FILE=\"squid.conf\" /Fp"$(INTDIR)\squid.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\squid.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=ws2_32.lib advapi32.lib psapi.lib iphlpapi.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\squid.pdb" /debug /machine:I386 /out:"$(OUTDIR)\squid.exe" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\access_log.obj" \ + "$(INTDIR)\acl.obj" \ + "$(INTDIR)\asn.obj" \ + "$(INTDIR)\auth_modules.obj" \ + "$(INTDIR)\authenticate.obj" \ + "$(INTDIR)\cache_manager.obj" \ + "$(INTDIR)\CacheDigest.obj" \ + "$(INTDIR)\carp.obj" \ + "$(INTDIR)\cbdata.obj" \ + "$(INTDIR)\client_db.obj" \ + "$(INTDIR)\client_side.obj" \ + "$(INTDIR)\comm.obj" \ + "$(INTDIR)\comm_select.obj" \ + "$(INTDIR)\debug.obj" \ + "$(INTDIR)\delay_pools.obj" \ + "$(INTDIR)\disk.obj" \ + "$(INTDIR)\dns.obj" \ + "$(INTDIR)\dns_internal.obj" \ + "$(INTDIR)\errorpage.obj" \ + "$(INTDIR)\ETag.obj" \ + "$(INTDIR)\event.obj" \ + "$(INTDIR)\fd.obj" \ + "$(INTDIR)\filemap.obj" \ + "$(INTDIR)\forward.obj" \ + "$(INTDIR)\fqdncache.obj" \ + "$(INTDIR)\ftp.obj" \ + "$(INTDIR)\globals.obj" \ + "$(INTDIR)\gopher.obj" \ + "$(INTDIR)\helper.obj" \ + "$(INTDIR)\htcp.obj" \ + "$(INTDIR)\http.obj" \ + "$(INTDIR)\HttpBody.obj" \ + "$(INTDIR)\HttpHdrCc.obj" \ + "$(INTDIR)\HttpHdrContRange.obj" \ + "$(INTDIR)\HttpHdrExtField.obj" \ + "$(INTDIR)\HttpHdrRange.obj" \ + "$(INTDIR)\HttpHeader.obj" \ + "$(INTDIR)\HttpHeaderTools.obj" \ + "$(INTDIR)\HttpMsg.obj" \ + "$(INTDIR)\HttpReply.obj" \ + "$(INTDIR)\HttpRequest.obj" \ + "$(INTDIR)\HttpStatusLine.obj" \ + "$(INTDIR)\icmp.obj" \ + "$(INTDIR)\icp_v2.obj" \ + "$(INTDIR)\icp_v3.obj" \ + "$(INTDIR)\ident.obj" \ + "$(INTDIR)\internal.obj" \ + "$(INTDIR)\ipc.obj" \ + "$(INTDIR)\ipcache.obj" \ + "$(INTDIR)\leakfinder.obj" \ + "$(INTDIR)\logfile.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\mem.obj" \ + "$(INTDIR)\MemBuf.obj" \ + "$(INTDIR)\MemPool.obj" \ + "$(INTDIR)\mime.obj" \ + "$(INTDIR)\multicast.obj" \ + "$(INTDIR)\neighbors.obj" \ + "$(INTDIR)\net_db.obj" \ + "$(INTDIR)\Packer.obj" \ + "$(INTDIR)\pconn.obj" \ + "$(INTDIR)\peer_digest.obj" \ + "$(INTDIR)\peer_select.obj" \ + "$(INTDIR)\redirect.obj" \ + "$(INTDIR)\referer.obj" \ + "$(INTDIR)\refresh.obj" \ + "$(INTDIR)\repl_modules.obj" \ + "$(INTDIR)\send-announce.obj" \ + "$(INTDIR)\snmp_agent.obj" \ + "$(INTDIR)\snmp_core.obj" \ + "$(INTDIR)\ssl.obj" \ + "$(INTDIR)\stat.obj" \ + "$(INTDIR)\StatHist.obj" \ + "$(INTDIR)\stmem.obj" \ + "$(INTDIR)\store.obj" \ + "$(INTDIR)\store_client.obj" \ + "$(INTDIR)\store_digest.obj" \ + "$(INTDIR)\store_dir.obj" \ + "$(INTDIR)\store_io.obj" \ + "$(INTDIR)\store_key_md5.obj" \ + "$(INTDIR)\store_log.obj" \ + "$(INTDIR)\store_modules.obj" \ + "$(INTDIR)\store_rebuild.obj" \ + "$(INTDIR)\store_swapin.obj" \ + "$(INTDIR)\store_swapmeta.obj" \ + "$(INTDIR)\store_swapout.obj" \ + "$(INTDIR)\String.obj" \ + "$(INTDIR)\string_arrays.obj" \ + "$(INTDIR)\test_cache_digest.obj" \ + "$(INTDIR)\tools.obj" \ + "$(INTDIR)\url.obj" \ + "$(INTDIR)\urn.obj" \ + "$(INTDIR)\useragent.obj" \ + "$(INTDIR)\wais.obj" \ + "$(INTDIR)\wccp.obj" \ + "$(INTDIR)\whois.obj" \ + "$(INTDIR)\win32.obj" \ + "..\libgnuregex\Debug\libgnuregex.lib" \ + "..\libmiscutil\Debug\libmiscutil.lib" \ + "..\libntlmauth\Debug\libntlmauth.lib" \ + "..\libsnmp\Debug\libsnmp.lib" + +"$(OUTDIR)\squid.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("squid.dep") +!INCLUDE "squid.dep" +!ELSE +!MESSAGE Warning: cannot find "squid.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "squid - Win32 Release" || "$(CFG)" == "squid - Win32 Debug" +SOURCE=..\..\..\src\access_log.c + +"$(INTDIR)\access_log.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\acl.c + +"$(INTDIR)\acl.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\asn.c + +"$(INTDIR)\asn.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\auth_modules.c + +"$(INTDIR)\auth_modules.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\authenticate.c + +"$(INTDIR)\authenticate.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\cache_manager.c + +"$(INTDIR)\cache_manager.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\CacheDigest.c + +"$(INTDIR)\CacheDigest.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\carp.c + +"$(INTDIR)\carp.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\cbdata.c + +"$(INTDIR)\cbdata.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\client_db.c + +"$(INTDIR)\client_db.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\client_side.c + +"$(INTDIR)\client_side.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\comm.c + +"$(INTDIR)\comm.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\comm_select.c + +"$(INTDIR)\comm_select.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\debug.c + +"$(INTDIR)\debug.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\delay_pools.c + +"$(INTDIR)\delay_pools.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\disk.c + +"$(INTDIR)\disk.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\dns.c + +"$(INTDIR)\dns.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\dns_internal.c + +"$(INTDIR)\dns_internal.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\errorpage.c + +"$(INTDIR)\errorpage.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ETag.c + +"$(INTDIR)\ETag.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\event.c + +"$(INTDIR)\event.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\fd.c + +"$(INTDIR)\fd.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\filemap.c + +"$(INTDIR)\filemap.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\forward.c + +"$(INTDIR)\forward.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\fqdncache.c + +"$(INTDIR)\fqdncache.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ftp.c + +"$(INTDIR)\ftp.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\globals.c + +"$(INTDIR)\globals.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\gopher.c + +"$(INTDIR)\gopher.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\helper.c + +"$(INTDIR)\helper.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\htcp.c + +"$(INTDIR)\htcp.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\http.c + +"$(INTDIR)\http.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpBody.c + +"$(INTDIR)\HttpBody.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHdrCc.c + +"$(INTDIR)\HttpHdrCc.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHdrContRange.c + +"$(INTDIR)\HttpHdrContRange.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHdrExtField.c + +"$(INTDIR)\HttpHdrExtField.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHdrRange.c + +"$(INTDIR)\HttpHdrRange.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHeader.c + +"$(INTDIR)\HttpHeader.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpHeaderTools.c + +"$(INTDIR)\HttpHeaderTools.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpMsg.c + +"$(INTDIR)\HttpMsg.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpReply.c + +"$(INTDIR)\HttpReply.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpRequest.c + +"$(INTDIR)\HttpRequest.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\HttpStatusLine.c + +"$(INTDIR)\HttpStatusLine.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\icmp.c + +"$(INTDIR)\icmp.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\icp_v2.c + +"$(INTDIR)\icp_v2.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\icp_v3.c + +"$(INTDIR)\icp_v3.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ident.c + +"$(INTDIR)\ident.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\internal.c + +"$(INTDIR)\internal.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ipc.c + +"$(INTDIR)\ipc.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ipcache.c + +"$(INTDIR)\ipcache.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\leakfinder.c + +"$(INTDIR)\leakfinder.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\logfile.c + +"$(INTDIR)\logfile.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\main.c + +"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\mem.c + +"$(INTDIR)\mem.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\MemBuf.c + +"$(INTDIR)\MemBuf.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\MemPool.c + +"$(INTDIR)\MemPool.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\mime.c + +"$(INTDIR)\mime.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\multicast.c + +"$(INTDIR)\multicast.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\neighbors.c + +"$(INTDIR)\neighbors.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\net_db.c + +"$(INTDIR)\net_db.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\Packer.c + +"$(INTDIR)\Packer.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\pconn.c + +"$(INTDIR)\pconn.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\peer_digest.c + +"$(INTDIR)\peer_digest.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\peer_select.c + +"$(INTDIR)\peer_select.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\redirect.c + +"$(INTDIR)\redirect.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\referer.c + +"$(INTDIR)\referer.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\refresh.c + +"$(INTDIR)\refresh.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\repl_modules.c + +"$(INTDIR)\repl_modules.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE="..\..\..\src\send-announce.c" + +"$(INTDIR)\send-announce.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\snmp_agent.c + +"$(INTDIR)\snmp_agent.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\snmp_core.c + +"$(INTDIR)\snmp_core.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\ssl.c + +"$(INTDIR)\ssl.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\stat.c + +"$(INTDIR)\stat.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\StatHist.c + +"$(INTDIR)\StatHist.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\stmem.c + +"$(INTDIR)\stmem.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store.c + +"$(INTDIR)\store.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_client.c + +"$(INTDIR)\store_client.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_digest.c + +"$(INTDIR)\store_digest.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_dir.c + +"$(INTDIR)\store_dir.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_io.c + +"$(INTDIR)\store_io.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_key_md5.c + +"$(INTDIR)\store_key_md5.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_log.c + +"$(INTDIR)\store_log.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_modules.c + +"$(INTDIR)\store_modules.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_rebuild.c + +"$(INTDIR)\store_rebuild.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_swapin.c + +"$(INTDIR)\store_swapin.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_swapmeta.c + +"$(INTDIR)\store_swapmeta.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\store_swapout.c + +"$(INTDIR)\store_swapout.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\String.c + +"$(INTDIR)\String.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\string_arrays.c + +"$(INTDIR)\string_arrays.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\test_cache_digest.c + +"$(INTDIR)\test_cache_digest.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\tools.c + +"$(INTDIR)\tools.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\url.c + +"$(INTDIR)\url.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\urn.c + +"$(INTDIR)\urn.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\useragent.c + +"$(INTDIR)\useragent.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\wais.c + +"$(INTDIR)\wais.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\wccp.c + +"$(INTDIR)\wccp.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\whois.c + +"$(INTDIR)\whois.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=..\..\..\src\win32.c + +"$(INTDIR)\win32.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!IF "$(CFG)" == "squid - Win32 Release" + +"libgnuregex - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libgnuregex" + $(MAKE) /$(MAKEFLAGS) /F ".\libgnuregex.mak" CFG="libgnuregex - Win32 Release" + cd "..\squid" + +"libgnuregex - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libgnuregex" + $(MAKE) /$(MAKEFLAGS) /F ".\libgnuregex.mak" CFG="libgnuregex - Win32 Release" RECURSE=1 CLEAN + cd "..\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"libgnuregex - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libgnuregex" + $(MAKE) /$(MAKEFLAGS) /F ".\libgnuregex.mak" CFG="libgnuregex - Win32 Debug" + cd "..\squid" + +"libgnuregex - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libgnuregex" + $(MAKE) /$(MAKEFLAGS) /F ".\libgnuregex.mak" CFG="libgnuregex - Win32 Debug" RECURSE=1 CLEAN + cd "..\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"libmiscutil - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libmiscutil" + $(MAKE) /$(MAKEFLAGS) /F ".\libmiscutil.mak" CFG="libmiscutil - Win32 Release" + cd "..\squid" + +"libmiscutil - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libmiscutil" + $(MAKE) /$(MAKEFLAGS) /F ".\libmiscutil.mak" CFG="libmiscutil - Win32 Release" RECURSE=1 CLEAN + cd "..\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"libmiscutil - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libmiscutil" + $(MAKE) /$(MAKEFLAGS) /F ".\libmiscutil.mak" CFG="libmiscutil - Win32 Debug" + cd "..\squid" + +"libmiscutil - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libmiscutil" + $(MAKE) /$(MAKEFLAGS) /F ".\libmiscutil.mak" CFG="libmiscutil - Win32 Debug" RECURSE=1 CLEAN + cd "..\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"PerlPreprocessing - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\PerlPreprocessing.mak" CFG="PerlPreprocessing - Win32 Release" + cd ".\squid" + +"PerlPreprocessing - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\PerlPreprocessing.mak" CFG="PerlPreprocessing - Win32 Release" RECURSE=1 CLEAN + cd ".\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"PerlPreprocessing - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\PerlPreprocessing.mak" CFG="PerlPreprocessing - Win32 Debug" + cd ".\squid" + +"PerlPreprocessing - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\PerlPreprocessing.mak" CFG="PerlPreprocessing - Win32 Debug" RECURSE=1 CLEAN + cd ".\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"libntlmauth - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libntlmauth" + $(MAKE) /$(MAKEFLAGS) /F ".\libntlmauth.mak" CFG="libntlmauth - Win32 Release" + cd "..\squid" + +"libntlmauth - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libntlmauth" + $(MAKE) /$(MAKEFLAGS) /F ".\libntlmauth.mak" CFG="libntlmauth - Win32 Release" RECURSE=1 CLEAN + cd "..\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"libntlmauth - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libntlmauth" + $(MAKE) /$(MAKEFLAGS) /F ".\libntlmauth.mak" CFG="libntlmauth - Win32 Debug" + cd "..\squid" + +"libntlmauth - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libntlmauth" + $(MAKE) /$(MAKEFLAGS) /F ".\libntlmauth.mak" CFG="libntlmauth - Win32 Debug" RECURSE=1 CLEAN + cd "..\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"libsnmp - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libsnmp" + $(MAKE) /$(MAKEFLAGS) /F ".\libsnmp.mak" CFG="libsnmp - Win32 Release" + cd "..\squid" + +"libsnmp - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libsnmp" + $(MAKE) /$(MAKEFLAGS) /F ".\libsnmp.mak" CFG="libsnmp - Win32 Release" RECURSE=1 CLEAN + cd "..\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"libsnmp - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libsnmp" + $(MAKE) /$(MAKEFLAGS) /F ".\libsnmp.mak" CFG="libsnmp - Win32 Debug" + cd "..\squid" + +"libsnmp - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32\libsnmp" + $(MAKE) /$(MAKEFLAGS) /F ".\libsnmp.mak" CFG="libsnmp - Win32 Debug" RECURSE=1 CLEAN + cd "..\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"modules - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\modules.mak" CFG="modules - Win32 Release" + cd ".\squid" + +"modules - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\modules.mak" CFG="modules - Win32 Release" RECURSE=1 CLEAN + cd ".\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"modules - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\modules.mak" CFG="modules - Win32 Debug" + cd ".\squid" + +"modules - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\modules.mak" CFG="modules - Win32 Debug" RECURSE=1 CLEAN + cd ".\squid" + +!ENDIF + +!IF "$(CFG)" == "squid - Win32 Release" + +"squid_conf_default - Win32 Release" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\squid_conf_default.mak" CFG="squid_conf_default - Win32 Release" + cd ".\squid" + +"squid_conf_default - Win32 ReleaseCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\squid_conf_default.mak" CFG="squid_conf_default - Win32 Release" RECURSE=1 CLEAN + cd ".\squid" + +!ELSEIF "$(CFG)" == "squid - Win32 Debug" + +"squid_conf_default - Win32 Debug" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\squid_conf_default.mak" CFG="squid_conf_default - Win32 Debug" + cd ".\squid" + +"squid_conf_default - Win32 DebugCLEAN" : + cd "\WORK\CYGWIN-SVC-2_5\PORT\WIN32" + $(MAKE) /$(MAKEFLAGS) /F ".\squid_conf_default.mak" CFG="squid_conf_default - Win32 Debug" RECURSE=1 CLEAN + cd ".\squid" + +!ENDIF + + +!ENDIF + Index: squid/port/win32/squid/squid.rc diff -u /dev/null squid/port/win32/squid/squid.rc:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/squid.rc Sat Jun 29 06:14:52 2002 @@ -0,0 +1,81 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "squid.rc2" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Italian (Italy) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA) +#ifdef _WIN32 +LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "squid.rc2\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Italian (Italy) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: squid/port/win32/squid/squid.rc2 diff -u /dev/null squid/port/win32/squid/squid.rc2:1.1.2.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squid/squid.rc2 Thu Sep 25 08:52:21 2003 @@ -0,0 +1,113 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" +#include "buildver.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Italian (Italy) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA) +#ifdef _WIN32 +LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION FILEVER + PRODUCTVERSION PRODUCTVER + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x21L +#else + FILEFLAGS 0x20L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "SQUID Web Proxy Cache - http://www.squid-cache.org/\0" + VALUE "FileDescription", "squid\0" + VALUE "FileVersion", STRFILEVER + VALUE "InternalName", "SquidNT\0" + VALUE "LegalCopyright", "Copyright © 2002 - 2003\0" + VALUE "LegalTrademarks", "GNU General Public License\0" + VALUE "OriginalFilename", "squid.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "SQUID Web Proxy Cache for Windows NT/2000\0" + VALUE "ProductVersion", STRPRODUCTVER + VALUE "SpecialBuild", "STABLE\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + + + +#endif // Italian (Italy) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: squid/port/win32/squidclient/.cvsignore diff -u /dev/null squid/port/win32/squidclient/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squidclient/.cvsignore Mon Apr 8 12:18:39 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/squidclient/squidclient.dsp diff -u /dev/null squid/port/win32/squidclient/squidclient.dsp:1.1.2.4 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/squidclient/squidclient.dsp Fri Apr 22 12:08:56 2005 @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="squidclient" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=squidclient - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "squidclient.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "squidclient.mak" CFG="squidclient - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "squidclient - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "squidclient - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "squidclient - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "squidclient - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "squidclient - Win32 Release" +# Name "squidclient - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\client.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/src/encrypt.c diff -u /dev/null squid/port/win32/src/encrypt.c:1.1.2.2 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/src/encrypt.c Fri Apr 26 13:31:48 2002 @@ -0,0 +1,323 @@ +/* encrypt.c - providing 56 bit DES encryption + Copyright (C) 1991 Jochen Obalek + + 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include + +#define BS 64 +#define BS2 32 +#define KS 48 +#define KS2 24 +#define IS 56 +#define IS2 28 + +static char schluessel[16][KS]; + + +static char PC1[] = +{ + 56, 48, 40, 32, 24, 16, 8, 0, + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, + 62, 54, 46, 38, 30, 22, 14, 6, + 61, 53, 45, 37, 29, 21, 13, 5, + 60, 52, 44, 36, 28, 20, 12, 4, + 27, 19, 11, 3 +}; + + +static char PC2[] = +{ + 13, 16, 10, 23, 0, 4, 2, 27, + 14, 5, 20, 9, 22, 18, 11, 3, + 25, 7, 15, 6, 26, 19, 12, 1, + 40, 51, 30, 36, 46, 54, 29, 39, + 50, 44, 32, 47, 43, 48, 38, 55, + 33, 52, 45, 41, 49, 35, 28, 31 +}; + + +static char IP[] = +{ + 57, 49, 41, 33, 25, 17, 9, 1, + 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, + 63, 55, 47, 39, 31, 23, 15, 7, + 56, 48, 40, 32, 24, 16, 8, 0, + 58, 50, 42, 34, 26, 18, 10, 2, + 60, 52, 44, 36, 28, 20, 12, 4, + 62, 54, 46, 38, 30, 22, 14, 6 +}; + + +static char EP[] = +{ + 7, 39, 15, 47, 23, 55, 31, 63, + 6, 38, 14, 46, 22, 54, 30, 62, + 5, 37, 13, 45, 21, 53, 29, 61, + 4, 36, 12, 44, 20, 52, 28, 60, + 3, 35, 11, 43, 19, 51, 27, 59, + 2, 34, 10, 42, 18, 50, 26, 58, + 1, 33, 9, 41, 17, 49, 25, 57, + 0, 32, 8, 40, 16, 48, 24, 56 +}; + + +static char E0[] = +{ + 31, 0, 1, 2, 3, 4, 3, 4, + 5, 6, 7, 8, 7, 8, 9, 10, + 11, 12, 11, 12, 13, 14, 15, 16, + 15, 16, 17, 18, 19, 20, 19, 20, + 21, 22, 23, 24, 23, 24, 25, 26, + 27, 28, 27, 28, 29, 30, 31, 0 +}; + + +static char E[KS]; + + +static char PERM[] = +{ + 15, 6, 19, 20, 28, 11, 27, 16, + 0, 14, 22, 25, 4, 17, 30, 9, + 1, 7, 23, 13, 31, 26, 2, 8, + 18, 12, 29, 5, 21, 10, 3, 24 +}; + + +static char S_BOX[][64] = +{ + { + 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, + 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, + 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, + 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13 + }, + { + 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, + 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, + 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, + 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9 + }, + { + 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, + 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, + 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, + 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12 + }, + { + 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, + 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, + 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, + 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14 + }, + { + 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, + 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, + 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, + 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3 + }, + { + 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, + 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, + 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, + 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13 + }, + { + 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, + 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, + 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, + 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12 + }, + { + 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, + 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, + 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, + 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 + } +}; + +static void +perm (a, e, pc, n) + register char *a, *e; + register char *pc; + int n; +{ + for (; n--; pc++, a++) + *a = e[*pc]; +} + +static void +crypt_main (nachr_l, nachr_r, schl) + register char *nachr_l, *nachr_r; + register char *schl; +{ + char tmp[KS]; + register int sbval; + register char *tp = tmp; + register char *e = E; + register int i, j; + + for (i = 0; i < 8; i++) + { + for (j = 0, sbval = 0; j < 6; j++) + sbval = (sbval << 1) | (nachr_r[*e++] ^ *schl++); + sbval = S_BOX[i][sbval]; + for (tp += 4, j = 4; j--; sbval >>= 1) + *--tp = sbval & 1; + tp += 4; + } + + e = PERM; + for (i = 0; i < BS2; i++) + *nachr_l++ ^= tmp[*e++]; +} + +void +encrypt (char *nachr, int decr) +{ + char (*schl)[KS] = decr ? schluessel + 15 : schluessel; + char tmp[BS]; + int i; + + perm (tmp, nachr, IP, BS); + + for (i = 8; i--;) + { + crypt_main (tmp, tmp + BS2, *schl); + if (decr) + schl--; + else + schl++; + crypt_main (tmp + BS2, tmp, *schl); + if (decr) + schl--; + else + schl++; + } + + perm (nachr, tmp, EP, BS); +} + +void +setkey (char *schl) +{ + char tmp1[IS]; + register unsigned int ls = 0x7efc; + register int i, j, k; + register int shval = 0; + register char *akt_schl; + + memcpy (E, E0, KS); + perm (tmp1, schl, PC1, IS); + + for (i = 0; i < 16; i++) + { + shval += 1 + (ls & 1); + akt_schl = schluessel[i]; + for (j = 0; j < KS; j++) + { + if ((k = PC2[j]) >= IS2) + { + if ((k += shval) >= IS) + k = (k - IS2) % IS2 + IS2; + } + else if ((k += shval) >= IS2) + k %= IS2; + *akt_schl++ = tmp1[k]; + } + ls >>= 1; + } +} + +char * +crypt (const char *wort, const char *salt) +{ + static char retkey[14]; + char key[BS + 2]; + char *k; + int tmp, keybyte; + int i, j; + + memset (key, 0, BS + 2); + + for (k = key, i = 0; i < BS; i++) + { + if (!(keybyte = *wort++)) + break; + k += 7; + for (j = 0; j < 7; j++, i++) + { + *--k = keybyte & 1; + keybyte >>= 1; + } + k += 8; + } + + setkey (key); + memset (key, 0, BS + 2); + + for (k = E, i = 0; i < 2; i++) + { + retkey[i] = keybyte = *salt++; + if (keybyte > 'Z') + keybyte -= 'a' - 'Z' - 1; + if (keybyte > '9') + keybyte -= 'A' - '9' - 1; + keybyte -= '.'; + + for (j = 0; j < 6; j++, keybyte >>= 1, k++) + { + if (!(keybyte & 1)) + continue; + tmp = *k; + *k = k[24]; + k[24] = tmp; + } + } + + for (i = 0; i < 25; i++) + encrypt (key, 0); + + for (k = key, i = 0; i < 11; i++) + { + for (j = keybyte = 0; j < 6; j++) + { + keybyte <<= 1; + keybyte |= *k++; + } + + keybyte += '.'; + if (keybyte > '9') + keybyte += 'A' - '9' - 1; + if (keybyte > 'Z') + keybyte += 'a' - 'Z' - 1; + retkey[i + 2] = keybyte; + } + + retkey[i + 2] = 0; + + if (!retkey[1]) + retkey[1] = *retkey; + + return retkey; +} + + Index: squid/port/win32/src/readdir.c diff -u /dev/null squid/port/win32/src/readdir.c:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/src/readdir.c Fri Jul 8 11:48:19 2005 @@ -0,0 +1,80 @@ +#include "config.h" +#include +#include +#include +#define strdup _strdup + +/********************************************************************** + * Implement dirent-style opendir/readdir/closedir on Window 95/NT + * + * Functions defined are opendir(), readdir() and closedir() with the + * same prototypes as the normal dirent.h implementation. + * + * Does not implement telldir(), seekdir(), rewinddir() or scandir(). + * The dirent struct is compatible with Unix, except that d_ino is + * always 1 and d_off is made up as we go along. + * + * The DIR typedef is not compatible with Unix. + **********************************************************************/ + +DIR * opendir(const char *dir) +{ + DIR *dp; + char *filespec; + long handle; + int index; + + filespec = malloc(strlen(dir) + 2 + 1); + strcpy(filespec, dir); + index = strlen(filespec) - 1; + if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\')) + filespec[index] = '\0'; + strcat(filespec, "/*"); + + dp = (DIR *)malloc(sizeof(DIR)); + dp->offset = 0; + dp->finished = 0; + dp->dir = strdup(dir); + + if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) { + if (errno == ENOENT) + dp->finished = 1; + else + return NULL; + } + + dp->handle = handle; + free(filespec); + + return dp; +} + +struct dirent * readdir(DIR *dp) +{ + if (!dp || dp->finished) return NULL; + + if (dp->offset != 0) { + if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { + dp->finished = 1; + return NULL; + } + } + dp->offset++; + + strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME); + dp->dent.d_ino = 1; + dp->dent.d_reclen = strlen(dp->dent.d_name); + dp->dent.d_off = dp->offset; + + return &(dp->dent); +} + +int closedir(DIR *dp) +{ + if (!dp) return 0; + _findclose(dp->handle); + if (dp->dir) free(dp->dir); + if (dp) free(dp); + + return 0; +} Index: squid/port/win32/unlinkd/.cvsignore diff -u /dev/null squid/port/win32/unlinkd/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/unlinkd/.cvsignore Mon Apr 8 12:18:39 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/unlinkd/unlinkd.dsp diff -u /dev/null squid/port/win32/unlinkd/unlinkd.dsp:1.1.2.3 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/unlinkd/unlinkd.dsp Fri Apr 22 12:08:56 2005 @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="unlinkd" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=unlinkd - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "unlinkd.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "unlinkd.mak" CFG="unlinkd - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "unlinkd - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "unlinkd - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "unlinkd - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "UNLINK_DAEMON" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "unlinkd - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "UNLINK_DAEMON" /D "HAVE_CONFIG_H" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "unlinkd - Win32 Release" +# Name "unlinkd - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\unlinkd.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/port/win32/win32_check_group/.cvsignore diff -u /dev/null squid/port/win32/win32_check_group/.cvsignore:1.1.2.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/win32_check_group/.cvsignore Sat Jun 29 06:21:45 2002 @@ -0,0 +1,3 @@ +.cvsignore +Debug +Release Index: squid/port/win32/win32_check_group/win32_check_group.dsp diff -u /dev/null squid/port/win32/win32_check_group/win32_check_group.dsp:1.1.4.5 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/port/win32/win32_check_group/win32_check_group.dsp Fri Apr 22 12:08:56 2005 @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="win32_check_group" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=win32_check_group - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "win32_check_group.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "win32_check_group.mak" CFG="win32_check_group - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "win32_check_group - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "win32_check_group - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "win32_check_group - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../../include" /I "../../../src" /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 netapi32.lib Advapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "win32_check_group - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../src" /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D _FILE_OFFSET_BITS=64 /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 netapi32.lib Advapi32.lib ws2_32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "win32_check_group - Win32 Release" +# Name "win32_check_group - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\win32_group\WIN32_check_group.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\helpers\external_acl\win32_group\win32_check_group.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Index: squid/snmplib/Makefile.am diff -u squid/snmplib/Makefile.am:1.2 squid/snmplib/Makefile.am:1.2.40.1 --- squid/snmplib/Makefile.am:1.2 Sat Sep 1 04:46:49 2001 +++ squid/snmplib/Makefile.am Sun Oct 27 05:14:18 2002 @@ -8,7 +8,11 @@ mib.c snmp_api_error.c \ snmp_msg.c \ snmp_pdu.c snmplib_debug.c -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include +else +INCLUDES = -I$(top_srcdir)/include +endif VERSION = 3.4 DEFS = -DSQUID_SNMP=1 Index: squid/snmplib/parse.c diff -u squid/snmplib/parse.c:1.2.6.2 squid/snmplib/parse.c:1.2.14.5 --- squid/snmplib/parse.c:1.2.6.2 Thu Jun 30 19:17:21 2005 +++ squid/snmplib/parse.c Sat Jul 2 02:58:58 2005 @@ -124,7 +124,7 @@ #define COUNTER 9 #define GAUGE 10 #define TIMETICKS 11 -#define OPAQUE 12 +#define SNMP_OPAQUE 12 #define NUL 13 #define SEQUENCE 14 #define OF 15 /* SEQUENCE OF */ @@ -137,7 +137,7 @@ #define NOACCESS 21 #define SNMP_STATUS 22 #define MANDATORY 23 -#define OPTIONAL 24 +#define SNMP_OPTIONAL 24 #define OBSOLETE 25 #define RECOMMENDED 26 #define PUNCT 27 @@ -165,9 +165,9 @@ struct tok tokens[] = { {"obsolete", sizeof("obsolete") - 1, OBSOLETE}, - {"Opaque", sizeof("Opaque") - 1, OPAQUE}, + {"Opaque", sizeof("Opaque") - 1, SNMP_OPAQUE}, {"recommended", sizeof("recommended") - 1, RECOMMENDED}, - {"optional", sizeof("optional") - 1, OPTIONAL}, + {"optional", sizeof("optional") - 1, SNMP_OPTIONAL}, {"mandatory", sizeof("mandatory") - 1, MANDATORY}, {"current", sizeof("current") - 1, MANDATORY}, {"not-accessible", sizeof("not-accessible") - 1, NOACCESS}, @@ -328,7 +328,7 @@ case TIMETICKS: translation_table[count] = TYPE_TIMETICKS; break; - case OPAQUE: + case SNMP_OPAQUE: translation_table[count] = TYPE_OPAQUE; break; case NUL: @@ -844,7 +844,7 @@ case COUNTER: case GAUGE: case TIMETICKS: - case OPAQUE: + case SNMP_OPAQUE: case NUL: case LABEL: strcpy(syntax, token); @@ -873,7 +873,7 @@ return 0; } type = get_token(fp, token); - if (type != MANDATORY && type != OPTIONAL && type != OBSOLETE && type != RECOMMENDED) { + if (type != MANDATORY && type != SNMP_OPTIONAL && type != OBSOLETE && type != RECOMMENDED) { print_error("Bad status", token, type); free_node(np); return 0; Index: squid/src/Makefile.am diff -u squid/src/Makefile.am:1.13.2.11 squid/src/Makefile.am:1.13.2.1.4.11 --- squid/src/Makefile.am:1.13.2.11 Wed Sep 28 19:13:47 2005 +++ squid/src/Makefile.am Sat Oct 1 01:36:48 2005 @@ -62,9 +62,15 @@ WIN32SOURCE = endif -SUBDIRS = fs repl auth +if ENABLE_MINGW32SPECIFIC +INCLUDES = -I$(top_srcdir)/port/win32/include -I$(srcdir) -I$(top_srcdir)/include +MINGWEXLIB = -lmingwex +else +INCLUDES = -I$(srcdir) -I$(top_srcdir)/include +MINGWEXLIB = +endif -INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include +SUBDIRS = fs repl auth EXTRA_PROGRAMS = \ unlinkd \ @@ -228,7 +234,8 @@ @LIB_MALLOC@ \ @SSLLIB@ \ -lmiscutil \ - @XTRA_LIBS@ + @XTRA_LIBS@ \ + $(MINGWEXLIB) unlinkd_SOURCES = unlinkd_LDADD = unlinkd-daemon.o @@ -291,6 +298,7 @@ DEFAULT_ICON_DIR = $(datadir)/icons DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@ DEFAULT_MIB_PATH = $(datadir)/mib.txt +DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ DEFS = @DEFS@ -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" @@ -342,7 +350,8 @@ s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\ s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\ s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ - s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;"\ + s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;\ + s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g;"\ < $(srcdir)/cf.data.pre >$@ store_modules.c: store_modules.sh Makefile Index: squid/src/access_log.c diff -u squid/src/access_log.c:1.15.6.8 squid/src/access_log.c:1.15.6.1.2.8 --- squid/src/access_log.c:1.15.6.8 Tue Mar 29 18:17:46 2005 +++ squid/src/access_log.c Tue Mar 29 23:21:26 2005 @@ -402,7 +402,7 @@ mcast_miss_to.sin_port = htons(Config.mcast_miss.port); mcast_miss_to.sin_addr.s_addr = Config.mcast_miss.addr.s_addr; mcast_miss_fd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, Config.mcast_miss.port, COMM_NONBLOCKING, Index: squid/src/acl.c diff -u squid/src/acl.c:1.43.2.35 squid/src/acl.c:1.43.2.1.4.37 --- squid/src/acl.c:1.43.2.35 Fri Mar 10 19:16:30 2006 +++ squid/src/acl.c Sat Mar 11 06:07:45 2006 @@ -2789,6 +2789,19 @@ * Solaris code by R. Gancarz */ +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_CYGWIN_ +#include +#endif + +struct arpreq { + struct sockaddr arp_pa; /* protocol address */ + struct sockaddr arp_ha; /* hardware address */ + int arp_flags; /* flags */ +}; + +#include +#else #ifdef _SQUID_SOLARIS_ #include #else @@ -2808,6 +2821,7 @@ #if HAVE_NETINET_IF_ETHER_H #include #endif +#endif /* * Decode an ascii representation (asc) of an ethernet adress, and place @@ -3091,6 +3105,57 @@ debug(28, 3) ("aclMatchArp: '%s' %s\n", inet_ntoa(c), splayLastResult ? "NOT found" : "found"); return (0 == splayLastResult); +#elif defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) + + DWORD dwNetTable = 0; + DWORD ipNetTableLen = 0; + PMIB_IPNETTABLE NetTable = NULL; + DWORD i; + splayNode **Top = dataptr; + struct arpreq arpReq; + + /* Get size of Windows ARP table */ + if (GetIpNetTable(NetTable, &ipNetTableLen, FALSE) != ERROR_INSUFFICIENT_BUFFER) { + debug(28, 0) ("Can't estimate ARP table size!\n"); + return 0; + } + + /* Allocate space for ARP table and assign pointers */ + if ((NetTable = (PMIB_IPNETTABLE)xmalloc(ipNetTableLen)) == NULL) { + debug(28, 0) ("Can't allocate temporary ARP table!\n"); + return 0; + } + + /* Get actual ARP table */ + if ((dwNetTable = GetIpNetTable(NetTable, &ipNetTableLen, FALSE)) != NO_ERROR) { + debug(28, 0) ("Can't retrieve ARP table!\n"); + xfree(NetTable); + return 0; + } + + /* Find MAC address from net table */ + for (i = 0 ; i < NetTable->dwNumEntries ; i++) { + if ((c.s_addr == NetTable->table[i].dwAddr) && (NetTable->table[i].dwType > 2)) { + arpReq.arp_ha.sa_family = AF_UNSPEC; + memcpy(arpReq.arp_ha.sa_data, NetTable->table[i].bPhysAddr, NetTable[i].table->dwPhysAddrLen); + } + } + xfree(NetTable); + if (arpReq.arp_ha.sa_data[0] == 0 && arpReq.arp_ha.sa_data[1] == 0 && + arpReq.arp_ha.sa_data[2] == 0 && arpReq.arp_ha.sa_data[3] == 0 && + arpReq.arp_ha.sa_data[4] == 0 && arpReq.arp_ha.sa_data[5] == 0) + return 0; + debug(28, 4) ("Got address %02x:%02x:%02x:%02x:%02x:%02x\n", + arpReq.arp_ha.sa_data[0] & 0xff, arpReq.arp_ha.sa_data[1] & 0xff, + arpReq.arp_ha.sa_data[2] & 0xff, arpReq.arp_ha.sa_data[3] & 0xff, + arpReq.arp_ha.sa_data[4] & 0xff, arpReq.arp_ha.sa_data[5] & 0xff); + + /* Do lookup */ + *Top = splay_splay(&arpReq.arp_ha.sa_data, *Top, aclArpCompare); + + debug(28, 3) ("aclMatchArp: '%s' %s\n", + inet_ntoa(c), splayLastResult ? "NOT found" : "found"); + return (0 == splayLastResult); #else WRITE ME; #endif @@ -3143,6 +3208,21 @@ return (d1[4] > d2[4]) ? 1 : -1; if (d1[5] != d2[5]) return (d1[5] > d2[5]) ? 1 : -1; +#elif defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) + const unsigned char *d1 = a; + const unsigned char *d2 = b; + if (d1[0] != d2[0]) + return (d1[0] > d2[0]) ? 1 : -1; + if (d1[1] != d2[1]) + return (d1[1] > d2[1]) ? 1 : -1; + if (d1[2] != d2[2]) + return (d1[2] > d2[2]) ? 1 : -1; + if (d1[3] != d2[3]) + return (d1[3] > d2[3]) ? 1 : -1; + if (d1[4] != d2[4]) + return (d1[4] > d2[4]) ? 1 : -1; + if (d1[5] != d2[5]) + return (d1[5] > d2[5]) ? 1 : -1; #else WRITE ME; #endif Index: squid/src/cache_cf.c diff -u squid/src/cache_cf.c:1.38.6.29 squid/src/cache_cf.c:1.38.6.3.2.26 --- squid/src/cache_cf.c:1.38.6.29 Wed Oct 26 19:13:24 2005 +++ squid/src/cache_cf.c Sun Oct 30 01:15:26 2005 @@ -269,7 +269,7 @@ if ((fp = fopen(file_name, "r")) == NULL) fatalf("Unable to open configuration file: %s: %s", file_name, xstrerror()); -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif cfg_filename = file_name; Index: squid/src/cache_diff.c diff -u squid/src/cache_diff.c:1.6 squid/src/cache_diff.c:1.6.74.1 --- squid/src/cache_diff.c:1.6 Fri Jan 12 00:20:32 2001 +++ squid/src/cache_diff.c Sat Mar 16 01:50:24 2002 @@ -137,7 +137,7 @@ fprintf(stderr, "cannot open %s: %s\n", fname, strerror(errno)); return 0; } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(file), O_BINARY); #endif scanned_count = cacheIndexScan(idx, fname, file); Index: squid/src/cache_manager.c diff -u squid/src/cache_manager.c:1.7.54.1 squid/src/cache_manager.c:1.7.62.4 --- squid/src/cache_manager.c:1.7.54.1 Thu Sep 1 19:13:43 2005 +++ squid/src/cache_manager.c Fri Sep 2 11:15:40 2005 @@ -63,6 +63,10 @@ static char *cachemgrPasswdGet(cachemgr_passwd *, const char *); static const char *cachemgrActionProtection(const action_table * at); static OBJH cachemgrShutdown; +static OBJH cachemgrReconfigure; +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) +static OBJH cachemgrBreak; +#endif static OBJH cachemgrMenu; static OBJH cachemgrOfflineToggle; @@ -283,6 +287,24 @@ } static void +cachemgrReconfigure(StoreEntry * sentry) +{ + debug(16, 0) ("Reconfigure by command.\n"); + reconfigure(SIGHUP); + storeAppendPrintf(sentry, "Reconfiguring Squid Process ...."); +} + +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) +static void +cachemgrBreak(StoreEntry * sentry) +{ + debug(16, 0) ("Break by command.\n"); + sigusr2_handle(SIGUSR2); + storeAppendPrintf(sentry, "Breaking Squid Process ...."); +} +#endif + +static void cachemgrOfflineToggle(StoreEntry * sentry) { Config.onoff.offline = !Config.onoff.offline; @@ -342,6 +364,14 @@ cachemgrRegister("shutdown", "Shut Down the Squid Process", cachemgrShutdown, 1, 1); + cachemgrRegister("reconfigure", + "Reconfigure the Squid Process", + cachemgrReconfigure, 1, 1); +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) + cachemgrRegister("break", + "Break the Squid Process", + cachemgrBreak, 1, 1); +#endif cachemgrRegister("offline_toggle", "Toggle offline_mode setting", cachemgrOfflineToggle, 1, 1); Index: squid/src/cachemgr.c diff -u squid/src/cachemgr.c:1.6.6.8 squid/src/cachemgr.c:1.6.14.13 --- squid/src/cachemgr.c:1.6.6.8 Tue Apr 26 19:16:18 2005 +++ squid/src/cachemgr.c Wed Apr 27 11:43:09 2005 @@ -179,7 +179,11 @@ static void error_html(const char *msg); static char *menu_url(cachemgr_request * req, const char *action); static int parse_status_line(const char *sline, const char **statusStr); +#ifdef _SQUID_MSWIN_ +static cachemgr_request *read_request(char *); +#else static cachemgr_request *read_request(void); +#endif static char *read_get_request(void); static char *read_post_request(void); @@ -190,6 +194,45 @@ static int check_target_acl(const char *hostname, int port); +#ifdef _SQUID_MSWIN_ +static int s_iInitCount = 0; +int Win32SockInit(void) +{ + int iVersionRequested; + WSADATA wsaData; + int err; + + if (s_iInitCount > 0) { + s_iInitCount++; + return (0); + } + else if (s_iInitCount < 0) + return (s_iInitCount); + + /* s_iInitCount == 0. Do the initailization */ + iVersionRequested = MAKEWORD(2, 0); + err = WSAStartup((WORD) iVersionRequested, &wsaData); + if (err) { + s_iInitCount = -1; + return (s_iInitCount); + } + if (LOBYTE(wsaData.wVersion) != 2 || + HIBYTE(wsaData.wVersion) != 0) { + s_iInitCount = -2; + WSACleanup(); + return (s_iInitCount); + } + s_iInitCount++; + return (s_iInitCount); +} + +void Win32SockCleanup(void) +{ + if (--s_iInitCount == 0) + WSACleanup(); + return; +} +#endif /* ifdef _SQUID_MSWIN_ */ static const char * safe_str(const char *str) @@ -460,7 +503,12 @@ read_reply(int s, cachemgr_request * req) { char buf[4 * 1024]; +#ifdef _SQUID_MSWIN_ + int reply; + FILE *fp = tmpfile(); +#else FILE *fp = fdopen(s, "r"); +#endif /* interpretation states */ enum { isStatusLine, isHeaders, isBodyStart, isBody, isForward, isEof, isForwardEof, isSuccess, isError @@ -477,6 +525,11 @@ perror("fdopen"); return 1; } +#ifdef _SQUID_MSWIN_ + while ((reply = recv(s, buf, sizeof(buf), 0)) > 0) + fwrite(buf, 1, reply, fp); + rewind(fp); +#endif if (parse_menu) action = "menu"; /* read reply interpreting one line at a time depending on state */ @@ -572,6 +625,9 @@ static struct sockaddr_in S; int s; int l; +#ifdef _SQUID_MSWIN_ + int answer; +#endif static char buf[2 * 1024]; if (req == NULL) { auth_html(CACHEMGR_HOSTNAME, CACHE_HTTP_PORT, ""); @@ -626,9 +682,19 @@ req->hostname, req->action, make_auth_header(req)); +#ifdef _SQUID_MSWIN_ + send(s, buf, l, 0); +#else write(s, buf, l); +#endif debug(1) fprintf(stderr, "wrote request: '%s'\n", buf); +#ifdef _SQUID_MSWIN_ + answer=read_reply(s, req); + closesocket(s); + return answer; +#else return read_reply(s, req); +#endif } int @@ -636,16 +702,34 @@ { char *s; cachemgr_request *req; +#ifdef _SQUID_MSWIN_ + int answer; +#endif safe_inet_addr("255.255.255.255", &no_addr); now = time(NULL); +#ifdef _SQUID_MSWIN_ + Win32SockInit(); + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); + _fmode = _O_BINARY; + if ((s = strrchr(argv[0], '\\'))) +#else if ((s = strrchr(argv[0], '/'))) +#endif progname = xstrdup(s + 1); else progname = xstrdup(argv[0]); if ((s = getenv("SCRIPT_NAME")) != NULL) script_name = xstrdup(s); +#ifdef _SQUID_MSWIN_ + req = read_request(NULL); + answer=process_request(req); + Win32SockCleanup(); + return answer; +#else req = read_request(); return process_request(req); +#endif } static char * read_post_request(void) @@ -674,10 +758,17 @@ return NULL; return xstrdup(s); } + +#ifdef _SQUID_MSWIN_ +static cachemgr_request * +read_request(char* buf) +{ +#else static cachemgr_request * read_request(void) { char *buf; +#endif cachemgr_request *req; char *s; char *t; @@ -688,7 +779,11 @@ (void) 0; else return NULL; +#ifdef _SQUID_MSWIN_ + if (strlen(buf) == 0 || strlen(buf) == 4000) +#else if (strlen(buf) == 0) +#endif return NULL; req = xcalloc(1, sizeof(cachemgr_request)); for (s = strtok(buf, "&"); s != NULL; s = strtok(NULL, "&")) { Index: squid/src/cf.data.pre diff -u squid/src/cf.data.pre:1.49.2.86 squid/src/cf.data.pre:1.49.2.5.4.83 --- squid/src/cf.data.pre:1.49.2.86 Sat Feb 25 19:13:57 2006 +++ squid/src/cf.data.pre Sun Feb 26 01:14:42 2006 @@ -786,6 +786,16 @@ see argument descriptions under ufs above + The awin32 store type: + + "awin32" uses the same storage format as "ufs", utilizing + WIN32-threads to avoid blocking the main Squid process on + disk-I/O. This was formerly known in Squid as async-io. + + cache_dir awin32 Directory-Name Mbytes L1 L2 [options] + + see argument descriptions under ufs above + The diskd store type: "diskd" uses the same storage format as "ufs", utilizing a @@ -1172,7 +1182,7 @@ NAME: hosts_file TYPE: string -DEFAULT: /etc/hosts +DEFAULT: @DEFAULT_HOSTS@ LOC: Config.etcHostsPath DOC_START Location of the host-local IP name-address associations @@ -1219,6 +1229,7 @@ IFDEF: USE_ICMP DOC_START Specify the location of the executable for the pinger process. + To disable, enter "none". DOC_END @@ -4140,6 +4151,8 @@ processes, these sleep delays will add up and your Squid will not service requests for some amount of time until all the child processes have been started. + On Windows value less then 1000 (1 milliseconds) are + rounded to 1000. DOC_END NAME: relaxed_header_parser Index: squid/src/cf_gen.c diff -u squid/src/cf_gen.c:1.10.6.3 squid/src/cf_gen.c:1.10.14.4 --- squid/src/cf_gen.c:1.10.6.3 Thu Jun 30 19:17:21 2005 +++ squid/src/cf_gen.c Sat Jul 2 02:58:58 2005 @@ -66,7 +66,7 @@ #if HAVE_ASSERT_H #include #endif -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) #include #endif #if HAVE_FCNTL_H @@ -158,7 +158,7 @@ perror(input_filename); exit(1); } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif state = sSTART; @@ -345,7 +345,7 @@ perror(output_filename); exit(1); } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif fprintf(fp, @@ -370,7 +370,7 @@ perror(conf_filename); exit(1); } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif gen_conf(entries, fp); Index: squid/src/client.c diff -u squid/src/client.c:1.8.6.7 squid/src/client.c:1.8.14.12 --- squid/src/client.c:1.8.6.7 Wed Mar 30 18:22:59 2005 +++ squid/src/client.c Thu Mar 31 03:35:22 2005 @@ -47,8 +47,10 @@ static SIGHDLR catch; static SIGHDLR pipe_handler; static void set_our_signal(void); +#ifndef _SQUID_MSWIN_ static ssize_t myread(int fd, void *buf, size_t len); static ssize_t mywrite(int fd, void *buf, size_t len); +#endif static int put_fd; static char *put_file = NULL; static struct stat sb; @@ -210,6 +212,12 @@ break; } } +#ifdef _SQUID_MSWIN_ + { + WSADATA wsaData; + WSAStartup(2, &wsaData); + } +#endif /* Build the HTTP request */ if (strncmp(url, "mgr:", 4) == 0) { char *t = xstrdup(url + 4); @@ -224,7 +232,7 @@ xstrerror()); exit(-1); } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(put_fd, O_BINARY); #endif fstat(put_fd, &sb); @@ -333,7 +341,11 @@ exit(1); } /* Send the HTTP request */ +#ifdef _SQUID_MSWIN_ + bytesWritten = send(conn, msg, strlen(msg), 0); +#else bytesWritten = mywrite(conn, msg, strlen(msg)); +#endif if (bytesWritten < 0) { perror("client: ERROR: write"); exit(1); @@ -344,8 +356,13 @@ if (put_file) { int x; lseek(put_fd, 0, SEEK_SET); +#ifdef _SQUID_MSWIN_ + while ((x = read(put_fd, buf, sizeof(buf))) > 0) { + x = write(conn, buf, x); +#else while ((x = myread(put_fd, buf, sizeof(buf))) > 0) { x = mywrite(conn, buf, x); +#endif total_bytes += x; if (x <= 0) break; @@ -355,11 +372,19 @@ } /* Read the data */ +#ifdef _SQUID_MSWIN_ + setmode(1, O_BINARY); + while ((len = recv(conn, buf, sizeof(buf), 0)) > 0) { +#else while ((len = myread(conn, buf, sizeof(buf))) > 0) { +#endif fsize += len; if (to_stdout) fwrite(buf, len, 1, stdout); } +#ifdef _SQUID_MSWIN_ + setmode(1, O_TEXT); +#endif (void) close(conn); /* done with socket */ if (interrupted) @@ -490,6 +515,7 @@ } +#ifndef _SQUID_MSWIN_ static ssize_t myread(int fd, void *buf, size_t len) { @@ -503,3 +529,4 @@ alarm(io_timeout); return write(fd, buf, len); } +#endif Index: squid/src/client_side.c diff -u squid/src/client_side.c:1.47.2.77 squid/src/client_side.c:1.47.2.1.4.71 --- squid/src/client_side.c:1.47.2.77 Fri Jun 2 15:51:12 2006 +++ squid/src/client_side.c Wed Jun 21 11:56:57 2006 @@ -3812,7 +3812,7 @@ } enter_suid(); fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, s->s.sin_addr, ntohs(s->s.sin_port), COMM_NONBLOCKING, @@ -3850,7 +3850,7 @@ } enter_suid(); fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, s->s.sin_addr, ntohs(s->s.sin_port), COMM_NONBLOCKING, Index: squid/src/comm.c diff -u squid/src/comm.c:1.18.6.6 squid/src/comm.c:1.18.6.1.2.12 --- squid/src/comm.c:1.18.6.6 Sat Sep 10 19:13:22 2005 +++ squid/src/comm.c Mon Feb 14 06:35:45 2005 @@ -33,6 +33,8 @@ * */ +#ifndef COMM_C +#define COMM_C #include "squid.h" #if defined(_SQUID_CYGWIN_) @@ -214,6 +216,9 @@ if ((flags & COMM_REUSEADDR)) commSetReuseAddr(new_socket); if (port > (u_short) 0) { +#ifdef _SQUID_MSWIN_ + if (sock_type != SOCK_DGRAM) +#endif commSetNoLinger(new_socket); if (opt_reuseaddr) commSetReuseAddr(new_socket); @@ -341,6 +346,11 @@ fdAdjustReserved(); return 0; } +#ifdef _SQUID_MSWIN_ + /* On Windows dup2() can't work correctly on Sockets, the */ + /* workaround is to close the destination Socket before call them. */ + close(cs->fd); +#endif if (dup2(fd2, cs->fd) < 0) { debug(5, 0) ("commResetFD: dup2: %s\n", xstrerror()); if (ENFILE == errno || EMFILE == errno) @@ -788,17 +798,24 @@ int commSetNonBlocking(int fd) { +#ifndef _SQUID_MSWIN_ int flags; int dummy = 0; -#ifdef _SQUID_CYGWIN_ +#endif +#if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) int nonblocking = TRUE; +#ifdef _SQUID_CYGWIN_ if (fd_table[fd].type != FD_PIPE) { +#endif if (ioctl(fd, FIONBIO, &nonblocking) < 0) { debug(50, 0) ("commSetNonBlocking: FD %d: %s %u\n", fd, xstrerror(), fd_table[fd].type); return COMM_ERROR; } +#ifdef _SQUID_CYGWIN_ } else { #endif +#endif +#ifndef _SQUID_MSWIN_ if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) { debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror()); return COMM_ERROR; @@ -807,6 +824,7 @@ debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror()); return COMM_ERROR; } +#endif #ifdef _SQUID_CYGWIN_ } #endif @@ -817,13 +835,18 @@ int commUnsetNonBlocking(int fd) { - int flags; +#ifdef _SQUID_MSWIN_ + int nonblocking = FALSE; + if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) { +#else int dummy = 0; + int flags; if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) { debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror()); return COMM_ERROR; } if (fcntl(fd, F_SETFL, flags & (~SQUID_NONBLOCK)) < 0) { +#endif debug(50, 0) ("commUnsetNonBlocking: FD %d: %s\n", fd, xstrerror()); return COMM_ERROR; } @@ -1015,3 +1038,4 @@ } } } +#endif /* COMM_C */ Index: squid/src/comm_select.c diff -u squid/src/comm_select.c:1.8.6.6 squid/src/comm_select.c:1.8.10.15 --- squid/src/comm_select.c:1.8.6.6 Sun May 11 19:14:21 2003 +++ squid/src/comm_select.c Sat Sep 13 09:28:06 2003 @@ -32,6 +32,8 @@ * */ +#ifndef COMM_SELECT_C +#define COMM_SELECT_C #include "squid.h" static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ @@ -536,6 +538,10 @@ PF *hdl = NULL; fd_set read_mask; fd_set write_mask; +#ifdef _SQUID_MSWIN_ + fd_set errfds; + FD_ZERO(&errfds); +#endif FD_ZERO(&read_mask); FD_ZERO(&write_mask); incoming_sockets_accepted = 0; @@ -558,7 +564,11 @@ getCurrentTime(); #endif statCounter.syscalls.selects++; +#ifdef _SQUID_MSWIN_ + if (select(maxfd, &read_mask, &write_mask, &errfds, &zero_tv) < 1) +#else if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) < 1) +#endif return incoming_sockets_accepted; for (i = 0; i < nfds; i++) { fd = fds[i]; @@ -655,19 +665,25 @@ int pending; int callicp = 0, callhttp = 0; int calldns = 0; - int maxindex; - int k; int j; #if DEBUG_FDBITS int i; #endif - fd_mask *fdsp; - fd_mask *pfdsp; - fd_mask tmask; static time_t last_timeout = 0; struct timeval poll_time; double timeout = current_dtime + (msec / 1000.0); fde *F; +#ifdef _SQUID_MSWIN_ + int no_bits; + fd_set errfds; + FD_ZERO(&errfds); +#else + fd_mask *pfdsp; + int k; + fd_mask *fdsp; + fd_mask tmask; + int maxindex; +#endif do { #if !ALARM_UPDATES_TIME double start; @@ -687,6 +703,49 @@ comm_select_http_incoming(); callicp = calldns = callhttp = 0; maxfd = Biggest_FD + 1; +#ifdef _SQUID_MSWIN_ + xmemcpy(&readfds, &global_readfds, sizeof(global_readfds)); + xmemcpy(&writefds, &global_writefds, sizeof(global_writefds)); + xmemcpy(&errfds, &global_writefds, sizeof(global_writefds)); + /* remove stalled FDs, and deal with pending descriptors */ + pending = 0; + FD_ZERO(&pendingfds); + for (j = 0; j < (int) readfds.fd_count; j++) { + register int readfds_handle = readfds.fd_array[j]; + no_bits = 1; + for ( fd = Biggest_FD; fd; fd-- ) { + if ( fd_table[fd].win32.handle == readfds_handle ) { + if (fd_table[fd].flags.open) { + no_bits = 0; + break; + } + } + } + if (no_bits) + continue; + switch (commDeferRead(fd)) { + case 0: + break; + case 1: + FD_CLR(fd, &readfds); + /* FD_CLR() decrements readfds.fd_count, so we must */ + /* decrement too the counter j */ + j--; + break; +#if DELAY_POOLS + case -1: + FD_SET(fd, &slowfds); + break; +#endif + default: + fatalf("bad return value from commDeferRead(FD %d)\n", fd); + } + if (FD_ISSET(fd, &readfds) && fd_table[fd].flags.read_pending) { + FD_SET(fd, &pendingfds); + pending++; + } + } +#else xmemcpy(&readfds, &global_readfds, howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES); xmemcpy(&writefds, &global_writefds, @@ -724,6 +783,7 @@ } } } +#endif #if DEBUG_FDBITS for (i = 0; i < maxfd; i++) { /* Check each open socket for a handler. */ @@ -751,13 +811,17 @@ poll_time.tv_sec = msec / 1000; poll_time.tv_usec = (msec % 1000) * 1000; statCounter.syscalls.selects++; +#ifdef _SQUID_MSWIN_ + num = select(maxfd, &readfds, &writefds, &errfds, &poll_time); +#else num = select(maxfd, &readfds, &writefds, NULL, &poll_time); +#endif statCounter.select_loops++; if (num >= 0 || pending > 0) break; if (ignoreErrno(errno)) break; - debug(50, 0) ("comm_select: select failure: %s\n", + debug(5, 0) ("comm_select: select failure: %s\n", xstrerror()); examine_select(&readfds, &writefds); return COMM_ERROR; @@ -777,6 +841,27 @@ if (num == 0 && pending == 0) continue; /* Scan return fd masks for ready descriptors */ +#ifdef _SQUID_MSWIN_ + assert(readfds.fd_count <= (unsigned int) Biggest_FD); + assert(pendingfds.fd_count <= (unsigned int) Biggest_FD); + for (j = 0; j < (int) max(readfds.fd_count, pendingfds.fd_count); j++) { + register int readfds_handle = readfds.fd_array[j]; + register int pendingfds_handle = pendingfds.fd_array[j]; + register int osfhandle; + no_bits = 1; + for ( fd = Biggest_FD; fd; fd-- ) { + osfhandle = fd_table[fd].win32.handle; + if (( osfhandle == readfds_handle ) || + ( osfhandle == pendingfds_handle )) { + if (fd_table[fd].flags.open) { + no_bits = 0; + break; + } + } + } + if (no_bits) + continue; +#else fdsp = (fd_mask *) & readfds; pfdsp = (fd_mask *) & pendingfds; maxindex = howmany(maxfd, FD_MASK_BITS); @@ -791,6 +876,7 @@ /* Found a set bit */ fd = (j * FD_MASK_BITS) + k; EBIT_CLR(tmask, k); /* this will be done */ +#endif #if DEBUG_FDBITS debug(5, 9) ("FD %d bit set for reading\n", fd); assert(FD_ISSET(fd, &readfds)); @@ -828,6 +914,39 @@ comm_select_http_incoming(); } } +#ifdef _SQUID_MSWIN_ + assert(errfds.fd_count <= (unsigned int) Biggest_FD); + for (j = 0; j < (int) errfds.fd_count; j++) { + register int errfds_handle = errfds.fd_array[j]; + for ( fd = Biggest_FD; fd; fd-- ) { + if ( fd_table[fd].win32.handle == errfds_handle ) + break; + } + if (fd_table[fd].flags.open) { + F = &fd_table[fd]; + if ((hdl = F->write_handler)) { + F->write_handler = NULL; + commUpdateWriteBits(fd, NULL); + hdl(fd, F->write_data); + statCounter.select_fds++; + } + } + } + assert(writefds.fd_count <= (unsigned int) Biggest_FD); + for (j = 0; j < (int) writefds.fd_count; j++) { + register int writefds_handle = writefds.fd_array[j]; + no_bits = 1; + for ( fd = Biggest_FD; fd; fd-- ) { + if ( fd_table[fd].win32.handle == writefds_handle ) { + if (fd_table[fd].flags.open) { + no_bits = 0; + break; + } + } + } + if (no_bits) + continue; +#else } fdsp = (fd_mask *) & writefds; for (j = 0; j < maxindex; j++) { @@ -841,6 +960,7 @@ /* Found a set bit */ fd = (j * FD_MASK_BITS) + k; EBIT_CLR(tmask, k); /* this will be done */ +#endif #if DEBUG_FDBITS debug(5, 9) ("FD %d bit set for writing\n", fd); assert(FD_ISSET(fd, &writefds)); @@ -870,7 +990,9 @@ comm_select_dns_incoming(); if (commCheckHTTPIncoming) comm_select_http_incoming(); +#ifndef _SQUID_MSWIN_ } +#endif } } if (callicp) @@ -1112,3 +1234,4 @@ { MAX_POLL_TIME = 10; } +#endif /* COMM_SELECT_C */ Index: squid/src/debug.c diff -u squid/src/debug.c:1.9.2.1 squid/src/debug.c:1.9.10.8 --- squid/src/debug.c:1.9.2.1 Tue Apr 5 19:16:20 2005 +++ squid/src/debug.c Thu Apr 7 14:34:20 2005 @@ -48,6 +48,10 @@ static void _db_print_stderr(const char *format, va_list args); static void _db_print_file(const char *format, va_list args); +#ifdef _SQUID_MSWIN_ +extern LPCRITICAL_SECTION dbg_mutex; +#endif + void #if STDC_HEADERS _db_print(const char *format,...) @@ -67,6 +71,33 @@ #define args2 args1 #define args3 args1 #endif +#ifdef _SQUID_MSWIN_ + /* Multiple WIN32 threads may call this simultaneously */ + if (!dbg_mutex) { + HMODULE krnl_lib = GetModuleHandle("Kernel32"); + BOOL(FAR WINAPI * InitializeCriticalSectionAndSpinCount) + (LPCRITICAL_SECTION, DWORD) = NULL; + if (krnl_lib) + (FARPROC) InitializeCriticalSectionAndSpinCount = + GetProcAddress(krnl_lib, + "InitializeCriticalSectionAndSpinCount"); + dbg_mutex = xcalloc(1, sizeof(CRITICAL_SECTION)); + + if (InitializeCriticalSectionAndSpinCount) { + /* let multiprocessor systems EnterCriticalSection() fast */ + if (!InitializeCriticalSectionAndSpinCount(dbg_mutex, 4000)) { + if (debug_log) { + fprintf(debug_log, "FATAL: _db_print: can't initialize critical section\n"); + fflush(debug_log); + } + fprintf(stderr, "FATAL: _db_print: can't initialize critical section\n"); + abort(); + } else + InitializeCriticalSection(dbg_mutex); + } + } + EnterCriticalSection(dbg_mutex); +#endif /* give a chance to context-based debugging to print current context */ if (!Ctx_Lock) ctx_print(); @@ -85,6 +116,9 @@ #if HAVE_SYSLOG _db_print_syslog(format, args3); #endif +#ifdef _SQUID_MSWIN_ + LeaveCriticalSection(dbg_mutex); +#endif va_end(args1); #if STDC_HEADERS va_end(args2); @@ -180,7 +214,7 @@ fflush(stderr); debug_log = stderr; } -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_CYGWIN_)||defined(_SQUID_MSWIN_) setmode(fileno(debug_log), O_TEXT); #endif } @@ -380,11 +414,25 @@ i--; snprintf(from, MAXPATHLEN, "%s.%d", debug_log_file, i - 1); snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, i); +#ifdef _SQUID_MSWIN_ + remove(to); +#endif rename(from, to); } +/* + * You can't rename open files on Microsoft "operating systems" + * so we close before renaming. + */ +#ifdef _SQUID_MSWIN_ + if (debug_log != stderr) + fclose(debug_log); +#endif /* Rotate the current log to .0 */ if (Config.Log.rotateNumber > 0) { snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, 0); +#ifdef _SQUID_MSWIN_ + remove(to); +#endif rename(debug_log_file, to); } /* Close and reopen the log. It may have been renamed "manually" Index: squid/src/defines.h diff -u squid/src/defines.h:1.15.6.4 squid/src/defines.h:1.15.10.7 --- squid/src/defines.h:1.15.6.4 Fri Mar 25 19:15:56 2005 +++ squid/src/defines.h Sat Mar 26 01:48:39 2005 @@ -135,7 +135,7 @@ #define AUTHENTICATE_AV_FACTOR 1000 /* AUTHENTICATION */ -#define NTLM_CHALLENGE_SZ 300 +#define NTLM_CHALLENGE_SZ 400 #define CONNECT_PORT 443 @@ -299,6 +299,21 @@ #define O_BINARY 0 #endif +/* CygWin & Windows NT Port */ +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#define _WIN_SQUID_SERVICE_CONTROL_STOP SERVICE_CONTROL_STOP +#define _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_SHUTDOWN +#define _WIN_SQUID_SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_INTERROGATE +#define _WIN_SQUID_SERVICE_CONTROL_ROTATE 128 +#define _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE 129 +#define _WIN_SQUID_SERVICE_CONTROL_DEBUG 130 +#define _WIN_SQUID_SERVICE_CONTROL_INTERRUPT 131 +#define _WIN_SQUID_DEFAULT_SERVICE_NAME "SquidNT" +#define _WIN_SQUID_SERVICE_OPTION "--ntservice" +#define _WIN_SQUID_RUN_MODE_INTERACTIVE 0 +#define _WIN_SQUID_RUN_MODE_SERVICE 1 +#endif + /* * Macro to find file access mode */ Index: squid/src/dns.c diff -u squid/src/dns.c:1.6.54.2 squid/src/dns.c:1.6.62.3 --- squid/src/dns.c:1.6.54.2 Sat Dec 6 19:14:43 2003 +++ squid/src/dns.c Mon Dec 8 12:36:48 2003 @@ -35,6 +35,7 @@ #include "squid.h" +#if USE_DNSSERVERS static helper *dnsservers = NULL; static void @@ -138,3 +139,4 @@ return Answer; } #endif /*SQUID_SNMP */ +#endif /* USE_DNSSERVERS */ Index: squid/src/dns_internal.c diff -u squid/src/dns_internal.c:1.15.6.9 squid/src/dns_internal.c:1.15.14.12 --- squid/src/dns_internal.c:1.15.6.9 Tue Sep 20 17:59:13 2005 +++ squid/src/dns_internal.c Tue Sep 20 03:07:27 2005 @@ -35,6 +35,11 @@ #include "squid.h" +/* MS VisualStudio Projects are monolitich, so we need the followin + #ifndef to exclude the internal DNS code from compile process when + using External DNS process. + */ +#ifndef USE_DNSSERVERS #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) #include #endif @@ -89,7 +94,9 @@ static void idnsAddNameserver(const char *buf); static void idnsFreeNameservers(void); static void idnsParseNameservers(void); +#ifndef _SQUID_MSWIN_ static void idnsParseResolvConf(void); +#endif #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) static void idnsParseWIN32Registry(void); #endif @@ -154,6 +161,7 @@ } } +#ifndef _SQUID_MSWIN_ static void idnsParseResolvConf(void) { @@ -165,7 +173,7 @@ debug(78, 1) ("%s: %s\n", _PATH_RESOLV_CONF, xstrerror()); return; } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#if defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif while (fgets(buf, 512, fp)) { @@ -182,6 +190,7 @@ } fclose(fp); } +#endif #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) static void @@ -658,7 +667,7 @@ else addr = Config.Addrs.udp_incoming; DnsSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, addr, 0, COMM_NONBLOCKING, @@ -827,3 +836,4 @@ return Answer; } #endif /*SQUID_SNMP */ +#endif /* USE_DNSSERVERS */ Index: squid/src/dnsserver.c diff -u squid/src/dnsserver.c:1.5.12.1 squid/src/dnsserver.c:1.5.20.1 --- squid/src/dnsserver.c:1.5.12.1 Mon Jul 1 10:24:36 2002 +++ squid/src/dnsserver.c Mon Apr 8 12:18:39 2002 @@ -142,7 +142,7 @@ #include "util.h" #include "snprintf.h" -#if !defined(_SQUID_AIX_) +#if !defined(_SQUID_AIX_) && !defined(_SQUID_MSWIN_) extern int h_errno; #endif @@ -336,6 +336,14 @@ } } +#ifdef _SQUID_MSWIN_ + { + WSADATA wsaData; + + WSAStartup(2, &wsaData); + } + fflush(stderr); +#endif for (;;) { memset(request, '\0', REQ_SZ); if (fgets(request, REQ_SZ, stdin) == NULL) Index: squid/src/errorpage.c diff -u squid/src/errorpage.c:1.15.6.14 squid/src/errorpage.c:1.15.6.1.4.14 --- squid/src/errorpage.c:1.15.6.14 Fri Mar 10 19:16:31 2006 +++ squid/src/errorpage.c Sat Mar 11 06:07:46 2006 @@ -177,15 +177,19 @@ char *text; snprintf(path, sizeof(path), "%s/%s", dir, page_name); +#ifdef _SQUID_MSWIN_ + fd = file_open(path, O_RDONLY | O_BINARY); +#else fd = file_open(path, O_RDONLY | O_TEXT); +#endif if (fd < 0 || fstat(fd, &sb) < 0) { debug(4, 0) ("errorTryLoadText: '%s': %s\n", path, xstrerror()); if (fd >= 0) file_close(fd); return NULL; } - text = xcalloc(sb.st_size + 2 + 1, 1); /* 2 == space for %S */ - if (FD_READ_METHOD(fd, text, sb.st_size) != sb.st_size) { + text = xcalloc((size_t) sb.st_size + 2 + 1, 1); /* 2 == space for %S */ + if (FD_READ_METHOD(fd, text, (size_t) sb.st_size) != sb.st_size) { debug(4, 0) ("errorTryLoadText: failed to fully read: '%s': %s\n", path, xstrerror()); xfree(text); Index: squid/src/fd.c diff -u squid/src/fd.c:1.7.12.1 squid/src/fd.c:1.7.16.9 --- squid/src/fd.c:1.7.12.1 Sun Dec 14 19:13:47 2003 +++ squid/src/fd.c Mon Dec 15 12:32:12 2003 @@ -37,6 +37,12 @@ int default_read_method(int, char *, int); int default_write_method(int, const char *, int); +#ifdef _SQUID_MSWIN_ +int socket_read_method(int, char *, int); +int socket_write_method(int, const char *, int); +int file_read_method(int, char *, int); +int file_write_method(int, const char *, int); +#endif const char *fdTypeStr[] = { @@ -93,6 +99,31 @@ F->timeout = 0; } +#ifdef _SQUID_MSWIN_ +int +socket_read_method(int fd, char *buf, int len) +{ + return (recv(fd, buf, len, 0)); +} + +int +file_read_method(int fd, char *buf, int len) +{ + return (_read(fd, buf, len)); +} + +int +socket_write_method(int fd, const char *buf, int len) +{ + return (send(fd, buf, len, 0)); +} + +file_write_method(int fd, const char *buf, int len) +{ + return (_write(fd, buf, len)); +} +#endif + int default_read_method(int fd, char *buf, int len) { @@ -119,8 +150,26 @@ debug(51, 3) ("fd_open FD %d %s\n", fd, desc); F->type = type; F->flags.open = 1; +#ifdef _SQUID_MSWIN_ + F->win32.handle = _get_osfhandle(fd); + switch (type) { + case FD_SOCKET: + case FD_PIPE: + F->read_method = &socket_read_method; + F->write_method = &socket_write_method; + break; + case FD_FILE: + case FD_LOG: + F->read_method = &file_read_method; + F->write_method = &file_write_method; + break; + default: + fatalf("fd_open(): unknown FD type - FD#: %i, type: %u, desc %s\n", fd, type, desc); + } +#else F->read_method = &default_read_method; F->write_method = &default_write_method; +#endif fdUpdateBiggest(fd, 1); if (desc) xstrncpy(F->desc, desc, FD_DESC_SZ); Index: squid/src/forward.c diff -u squid/src/forward.c:1.13.6.17 squid/src/forward.c:1.13.12.18 --- squid/src/forward.c:1.13.6.17 Wed Jun 21 05:54:36 2006 +++ squid/src/forward.c Wed Jun 21 11:56:57 2006 @@ -405,7 +405,7 @@ debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n", inet_ntoa(outgoing), tos); fd = comm_openex(SOCK_STREAM, - 0, + IPPROTO_TCP, outgoing, 0, COMM_NONBLOCKING, Index: squid/src/ftp.c diff -u squid/src/ftp.c:1.18.6.27 squid/src/ftp.c:1.18.6.1.4.26 --- squid/src/ftp.c:1.18.6.27 Sat Feb 25 19:13:57 2006 +++ squid/src/ftp.c Sun Feb 26 01:14:43 2006 @@ -1786,7 +1786,7 @@ } /* Open data channel with the same local address as control channel */ fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, addr.sin_addr, 0, COMM_NONBLOCKING, @@ -1926,7 +1926,7 @@ port = ntohs(addr.sin_port); } fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, addr.sin_addr, port, COMM_NONBLOCKING | (fallback ? COMM_REUSEADDR : 0), Index: squid/src/globals.h diff -u squid/src/globals.h:1.14.6.7 squid/src/globals.h:1.14.14.10 --- squid/src/globals.h:1.14.6.7 Mon Jun 13 19:15:00 2005 +++ squid/src/globals.h Sat Jun 18 13:00:49 2005 @@ -159,8 +159,16 @@ extern hash_table *proxy_auth_username_cache; /* NULL */ extern int incoming_sockets_accepted; #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +extern unsigned int WIN32_Socks_initialized; /* 0 */ extern unsigned int WIN32_OS_version; /* 0 */ extern char *WIN32_OS_string; /* NULL */ +extern char *WIN32_Service_name; /* NULL */ +extern char *WIN32_Command_Line; /* NULL */ +extern char *WIN32_Service_Command_Line; /* NULL */ +extern unsigned int WIN32_run_mode; /* _WIN_SQUID_RUN_MODE_INTERACTIVE */ +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) +extern int do_debug; /* 0 */ +#endif #endif #if HAVE_SBRK extern void *sbrk_start; /* 0 */ Index: squid/src/helper.c diff -u squid/src/helper.c:1.16.2.16 squid/src/helper.c:1.16.10.24 --- squid/src/helper.c:1.16.2.16 Fri Mar 10 19:16:31 2006 +++ squid/src/helper.c Sat Mar 11 06:07:46 2006 @@ -70,6 +70,10 @@ int rfd; int wfd; wordlist *w; +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; + pid_t pid; +#endif if (hlp->cmdline == NULL) return; progname = hlp->cmdline->key; @@ -94,7 +98,11 @@ args, shortname, &rfd, - &wfd); + &wfd +#ifdef _SQUID_MSWIN_ + , &hIpc, &pid +#endif + ); if (x < 0) { debug(84, 1) ("WARNING: Cannot run '%s' process.\n", progname); continue; @@ -102,7 +110,12 @@ hlp->n_running++; hlp->n_active++; srv = cbdataAlloc(helper_server); +#ifdef _SQUID_MSWIN_ + srv->hIpc = hIpc; + srv->pid = pid; +#else srv->pid = x; +#endif srv->index = k; srv->rfd = rfd; srv->wfd = wfd; @@ -149,6 +162,11 @@ int rfd; int wfd; wordlist *w; +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; + pid_t pid; +#endif + if (hlp->cmdline == NULL) return; progname = hlp->cmdline->key; @@ -173,7 +191,11 @@ args, shortname, &rfd, - &wfd); + &wfd +#ifdef _SQUID_MSWIN_ + , &hIpc, &pid +#endif + ); if (x < 0) { debug(84, 1) ("WARNING: Cannot run '%s' process.\n", progname); continue; @@ -181,7 +203,12 @@ hlp->n_running++; hlp->n_active++; srv = cbdataAlloc(helper_stateful_server); +#ifdef _SQUID_MSWIN_ + srv->hIpc = hIpc; + srv->pid = pid; +#else srv->pid = x; +#endif srv->flags.reserved = 0; srv->stats.submits = 0; srv->index = k; @@ -437,6 +464,11 @@ helperShutdown(helper * hlp) { dlink_node *link = hlp->servers.head; +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; + pid_t pid; + int no; +#endif while (link) { int wfd; helper_server *srv; @@ -461,9 +493,26 @@ continue; } srv->flags.closing = 1; +#ifdef _SQUID_MSWIN_ + hIpc = srv->hIpc; + pid = srv->pid; + no = srv->index + 1; + shutdown(srv->wfd, SD_BOTH); +#endif wfd = srv->wfd; srv->wfd = -1; comm_close(wfd); +#ifdef _SQUID_MSWIN_ + if (hIpc) { + if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) { + getCurrentTime(); + debug(84, 1) ("helperShutdown: WARNING: %s #%d (%s,%ld) " + "didn't exit in 5 seconds\n", + hlp->id_name, no, hlp->cmdline->key, (long int)pid); + } + CloseHandle(hIpc); + } +#endif } } @@ -472,6 +521,11 @@ { dlink_node *link = hlp->servers.head; helper_stateful_server *srv; +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; + pid_t pid; + int no; +#endif int wfd; while (link) { srv = link->data; @@ -500,9 +554,26 @@ continue; } srv->flags.closing = 1; +#ifdef _SQUID_MSWIN_ + hIpc = srv->hIpc; + pid = srv->pid; + no = srv->index + 1; + shutdown(srv->wfd, SD_BOTH); +#endif wfd = srv->wfd; srv->wfd = -1; comm_close(wfd); +#ifdef _SQUID_MSWIN_ + if (hIpc) { + if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) { + getCurrentTime(); + debug(84, 1) ("helperShutdown: WARNING: %s #%d (%s,%ld) " + "didn't exit in 5 seconds\n", + hlp->id_name, no, hlp->cmdline->key, (long int)pid); + } + CloseHandle(hIpc); + } +#endif } } Index: squid/src/htcp.c diff -u squid/src/htcp.c:1.9.2.7 squid/src/htcp.c:1.9.10.8 --- squid/src/htcp.c:1.9.2.7 Fri May 12 09:51:33 2006 +++ squid/src/htcp.c Sat May 13 05:26:30 2006 @@ -860,7 +860,7 @@ } enter_suid(); htcpInSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, Config.Port.htcp, COMM_NONBLOCKING, @@ -874,7 +874,7 @@ if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); htcpOutSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_outgoing, Config.Port.htcp, COMM_NONBLOCKING, Index: squid/src/http.c diff -u squid/src/http.c:1.17.6.32 squid/src/http.c:1.17.6.1.4.27 --- squid/src/http.c:1.17.6.32 Tue Oct 18 19:13:21 2005 +++ squid/src/http.c Thu Oct 20 02:12:45 2005 @@ -607,7 +607,7 @@ } } if (len < 0) { - debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n", + debug(11, 2) ("httpReadReply: FD %d: read failure: %s.\n", fd, xstrerror()); if (ignoreErrno(errno)) { commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0); Index: squid/src/icmp.c diff -u squid/src/icmp.c:1.4.66.4 squid/src/icmp.c:1.4.74.10 --- squid/src/icmp.c:1.4.66.4 Thu Jun 12 19:18:30 2003 +++ squid/src/icmp.c Sat Jun 14 03:57:47 2003 @@ -50,6 +50,11 @@ static void icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf); #endif +#ifdef _SQUID_MSWIN_ +static HANDLE hIpc; +static pid_t pid; +#endif + static void icmpSendEcho(struct in_addr to, int opcode, const char *payload, int len) { @@ -71,6 +76,8 @@ static int fail_count = 0; pingerReplyData preply; static struct sockaddr_in F; + if (icmp_sock < 0) + return; commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0); memset(&preply, '\0', sizeof(pingerReplyData)); statCounter.syscalls.sock.recvfroms++; @@ -79,7 +86,7 @@ sizeof(pingerReplyData), 0); if (n < 0 && EAGAIN != errno) { - debug(50, 1) ("icmpRecv: recv: %s\n", xstrerror()); + debug(37, 1) ("icmpRecv: recv: %s\n", xstrerror()); if (++fail_count == 10 || errno == ECONNREFUSED) icmpClose(); return; @@ -117,7 +124,7 @@ inet_ntoa(pkt->to), (int) pkt->opcode, pkt->psize); x = send(icmp_sock, (char *) pkt, len, 0); if (x < 0) { - debug(50, 1) ("icmpSend: send: %s\n", xstrerror()); + debug(37, 1) ("icmpSend: send: %s\n", xstrerror()); if (errno == ECONNREFUSED || errno == EPIPE) { icmpClose(); return; @@ -155,6 +162,8 @@ char *payload; int len; int ulen; + if (icmp_sock < 0) + return; debug(37, 3) ("icmpSourcePing: '%s'\n", url); if ((ulen = strlen(url)) > MAX_URL) return; @@ -173,6 +182,8 @@ icmpDomainPing(struct in_addr to, const char *domain) { #if USE_ICMP + if (icmp_sock < 0) + return; debug(37, 3) ("icmpDomainPing: '%s'\n", domain); icmpSendEcho(to, S_ICMP_DOM, domain, 0); #endif @@ -186,6 +197,10 @@ int x; int rfd; int wfd; + if (strcmp(Config.Program.pinger, "none") == 0) { + debug(37, 1) ("Pinger disabled\n"); + return; + } args[0] = "(pinger)"; args[1] = NULL; x = ipcCreate(IPC_UDP_SOCKET, @@ -193,7 +208,11 @@ args, "Pinger Socket", &rfd, - &wfd); + &wfd +#ifdef _SQUID_MSWIN_ + , &hIpc, &pid +#endif + ); if (x < 0) return; assert(rfd == wfd); @@ -201,7 +220,7 @@ fd_note(icmp_sock, "pinger"); commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0); commSetTimeout(icmp_sock, -1, NULL, NULL); - debug(29, 1) ("Pinger socket opened on FD %d\n", icmp_sock); + debug(37, 1) ("Pinger socket opened on FD %d\n", icmp_sock); #endif } @@ -211,8 +230,22 @@ #if USE_ICMP if (icmp_sock < 0) return; - debug(29, 1) ("Closing Pinger socket on FD %d\n", icmp_sock); + debug(37, 1) ("Closing Pinger socket on FD %d\n", icmp_sock); +#ifdef _SQUID_MSWIN_ + send(icmp_sock, "$shutdown\n", 10, 0); +#endif comm_close(icmp_sock); +#ifdef _SQUID_MSWIN_ + if (hIpc) { + if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) { + getCurrentTime(); + debug(37, 1) + ("icmpClose: WARNING: (pinger,%ld) didn't exit in 12 seconds\n", + (long int)pid); + } + CloseHandle(hIpc); + } +#endif icmp_sock = -1; #endif } Index: squid/src/icp_v2.c diff -u squid/src/icp_v2.c:1.5 squid/src/icp_v2.c:1.5.34.1 --- squid/src/icp_v2.c:1.5 Fri May 4 06:39:12 2001 +++ squid/src/icp_v2.c Sun Mar 17 10:16:06 2002 @@ -413,7 +413,7 @@ return; enter_suid(); theInIcpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, port, COMM_NONBLOCKING, @@ -434,7 +434,7 @@ if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); theOutIcpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, addr, port, COMM_NONBLOCKING, Index: squid/src/ident.c diff -u squid/src/ident.c:1.8.38.1 squid/src/ident.c:1.8.46.2 --- squid/src/ident.c:1.8.38.1 Fri May 12 09:51:33 2006 +++ squid/src/ident.c Sat May 13 05:26:30 2006 @@ -206,7 +206,7 @@ return; } fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, me->sin_addr, 0, COMM_NONBLOCKING, Index: squid/src/ipc.c diff -u squid/src/ipc.c:1.7.6.1 squid/src/ipc.c:1.7.10.15 --- squid/src/ipc.c:1.7.6.1 Sat Feb 25 19:13:57 2006 +++ squid/src/ipc.c Sun Feb 26 01:14:43 2006 @@ -35,6 +35,39 @@ #include "squid.h" +#ifdef _SQUID_MSWIN_ +#ifndef _MSWSOCK_ +#include +#endif +#include + +struct ipc_params +{ + int type; + int crfd; + int cwfd; + struct sockaddr_in PS; + const char *prog; + char **args; +}; + +struct thread_params +{ + int type; + int rfd; + int send_fd; + const char *prog; + pid_t pid; +}; + +static int __stdcall ipc_thread_1(struct ipc_params *params); +static int __stdcall ipc_thread_2(struct thread_params *params); + +static const char *ok_string = "OK\n"; +static const char *err_string = "ERR\n"; +static const char *shutdown_string = "$shutdown\n"; +#endif + static const char *hello_string = "hi there\n"; #define HELLO_BUF_SZ 32 static char hello_buf[HELLO_BUF_SZ]; @@ -56,8 +89,19 @@ } int +#ifdef _SQUID_MSWIN_ +ipcCreate(int type, const char *prog, const char *const args[], const char *name, int *rfd, int *wfd, HANDLE * hIpc, pid_t * ppid) +#else ipcCreate(int type, const char *prog, const char *const args[], const char *name, int *rfd, int *wfd) +#endif { +#ifdef _SQUID_MSWIN_ + unsigned long thread; + struct ipc_params params; + int opt; + int optlen = sizeof(opt); + DWORD ecode = 0; +#endif pid_t pid; struct sockaddr_in CS; struct sockaddr_in PS; @@ -65,13 +109,15 @@ int prfd = -1; int cwfd = -1; int pwfd = -1; + socklen_t len; +#ifndef _SQUID_MSWIN_ int fd; int t1, t2, t3; - socklen_t len; int tmp_s; #if HAVE_PUTENV char *env_str; #endif +#endif int x; #if HAVE_POLL && defined(_SQUID_OSF_) @@ -82,47 +128,66 @@ *rfd = -1; if (wfd) *wfd = -1; +#ifdef _SQUID_MSWIN_ + if (hIpc) + *hIpc = NULL; + if (ppid) + *ppid = -1; + + if (WIN32_OS_version !=_WIN_OS_WINNT) { + getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, &optlen); + opt = opt & ~(SO_SYNCHRONOUS_NONALERT | SO_SYNCHRONOUS_ALERT); + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, sizeof(opt)); + } +#endif if (type == IPC_TCP_SOCKET) { crfd = cwfd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_STREAM, - 0, /* protocol */ + IPPROTO_TCP, /* protocol */ local_addr, 0, /* port */ 0, /* blocking */ name); } else if (type == IPC_UDP_SOCKET) { crfd = cwfd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, local_addr, 0, 0, name); } else if (type == IPC_FIFO) { +#ifdef _SQUID_MSWIN_ + debug(54, 0) + ("ipcCreate: %s: use IPC_TCP_SOCKET instead of IP_FIFO on Windows\n", + prog); + assert(0); +#else int p2c[2]; int c2p[2]; if (pipe(p2c) < 0) { - debug(50, 0) ("ipcCreate: pipe: %s\n", xstrerror()); + debug(54, 0) ("ipcCreate: pipe: %s\n", xstrerror()); return -1; } if (pipe(c2p) < 0) { - debug(50, 0) ("ipcCreate: pipe: %s\n", xstrerror()); + debug(54, 0) ("ipcCreate: pipe: %s\n", xstrerror()); return -1; } fd_open(prfd = p2c[0], FD_PIPE, "IPC FIFO Parent Read"); fd_open(cwfd = p2c[1], FD_PIPE, "IPC FIFO Child Write"); fd_open(crfd = c2p[0], FD_PIPE, "IPC FIFO Child Read"); fd_open(pwfd = c2p[1], FD_PIPE, "IPC FIFO Parent Write"); +#endif } else { assert(IPC_NONE); } @@ -131,6 +196,14 @@ debug(54, 3) ("ipcCreate: crfd FD %d\n", crfd); debug(54, 3) ("ipcCreate: cwfd FD %d\n", cwfd); +#ifdef _SQUID_MSWIN_ + if (WIN32_OS_version !=_WIN_OS_WINNT) { + getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, &optlen); + opt = opt | SO_SYNCHRONOUS_NONALERT; + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, optlen); + } +#endif + if (crfd < 0) { debug(54, 0) ("ipcCreate: Failed to create child FD.\n"); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); @@ -143,7 +216,7 @@ len = sizeof(PS); memset(&PS, '\0', len); if (getsockname(pwfd, (struct sockaddr *) &PS, &len) < 0) { - debug(50, 0) ("ipcCreate: getsockname: %s\n", xstrerror()); + debug(54, 0) ("ipcCreate: getsockname: %s\n", xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } debug(54, 3) ("ipcCreate: FD %d sockaddr %s:%d\n", @@ -166,10 +239,25 @@ } /* flush or else we get dup data if unbuffered_logs is set */ logsFlush(); +#ifdef _SQUID_MSWIN_ + params.type = type; + params.crfd = crfd; + params.cwfd = cwfd; + params.PS = PS; + params.prog = prog; + params.args = (char **) args; + + thread = _beginthreadex(NULL, 0, ipc_thread_1, ¶ms, 0, NULL); + + if (thread == 0) { + debug(54, 1) ("ipcCreate: _beginthread: %s\n", xstrerror()); +#else if ((pid = fork()) < 0) { - debug(50, 1) ("ipcCreate: fork: %s\n", xstrerror()); + debug(54, 1) ("ipcCreate: fork: %s\n", xstrerror()); +#endif return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } +#ifndef _SQUID_MSWIN_ if (pid > 0) { /* parent */ /* close shared socket with child */ comm_close(crfd); @@ -177,24 +265,74 @@ comm_close(cwfd); cwfd = crfd = -1; if (type == IPC_TCP_SOCKET || type == IPC_UDP_SOCKET) { +#else + { + { +#endif if (comm_connect_addr(pwfd, &CS) == COMM_ERROR) +#ifdef _SQUID_MSWIN_ + { + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); + } +#else return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); +#endif } memset(hello_buf, '\0', HELLO_BUF_SZ); +#ifdef _SQUID_MSWIN_ + x = recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0); +#else if (type == IPC_UDP_SOCKET) x = recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0); else x = read(prfd, hello_buf, HELLO_BUF_SZ - 1); +#endif if (x < 0) { - debug(50, 0) ("ipcCreate: PARENT: hello read test failed\n"); - debug(50, 0) ("--> read: %s\n", xstrerror()); + debug(54, 0) ("ipcCreate: PARENT: hello read test failed\n"); + debug(54, 0) ("--> read: %s\n", xstrerror()); +#ifdef _SQUID_MSWIN_ + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); +#else return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); +#endif } else if (strcmp(hello_buf, hello_string)) { debug(54, 0) ("ipcCreate: PARENT: hello read test failed\n"); debug(54, 0) ("--> read returned %d\n", x); debug(54, 0) ("--> got '%s'\n", rfc1738_escape(hello_buf)); +#ifdef _SQUID_MSWIN_ + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); +#else return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); +#endif } +#ifdef _SQUID_MSWIN_ + x = send(pwfd, ok_string, strlen(ok_string), 0); + if (x < 0) { + debug(54, 0) ("ipcCreate: PARENT: OK write test failed\n"); + debug(54, 0) ("--> read: %s\n", xstrerror()); + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); + } + memset(hello_buf, '\0', HELLO_BUF_SZ); + x = recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0); + if (x < 0) { + debug(54, 0) ("ipcCreate: PARENT: OK read test failed\n"); + debug(54, 0) ("--> read: %s\n", xstrerror()); + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); + } else if (!strcmp(hello_buf, err_string)) { + debug(54, 0) ("ipcCreate: PARENT: OK read test failed\n"); + debug(54, 0) ("--> read returned %d\n", x); + debug(54, 0) ("--> got '%s'\n", rfc1738_escape(hello_buf)); + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); + } + hello_buf[x] = '\0'; + pid = atol(hello_buf); +#endif commSetTimeout(prfd, -1, NULL, NULL); commSetNonBlocking(prfd); commSetNonBlocking(pwfd); @@ -202,6 +340,30 @@ *rfd = prfd; if (wfd) *wfd = pwfd; +#ifdef _SQUID_MSWIN_ + fd_table[prfd].flags.ipc = 1; + fd_table[pwfd].flags.ipc = 1; + fd_table[crfd].flags.ipc = 1; + fd_table[cwfd].flags.ipc = 1; + if (Config.sleep_after_fork) { + /* XXX emulation of usleep() */ + DWORD sl; + sl = Config.sleep_after_fork / 1000; + if (sl == 0) + sl = 1; + Sleep(sl); + } + if (GetExitCodeThread((HANDLE) thread, &ecode) && ecode == STILL_ACTIVE) { + if (hIpc) + *hIpc = (HANDLE) thread; + if (ppid) + *ppid = pid; + return pwfd; + } else { + CloseHandle((HANDLE)thread); + return ipcCloseAllFD(prfd, pwfd, -1, -1); + } +#else fd_table[prfd].flags.ipc = 1; fd_table[pwfd].flags.ipc = 1; if (Config.sleep_after_fork) { @@ -212,7 +374,61 @@ select(0, NULL, NULL, NULL, &sl); } return pid; +#endif + } +#ifdef _SQUID_MSWIN_ +} + +static int +ipcSend(int cwfd, const char *buf, int len) +{ + int x; + + x = send(cwfd, buf, len, 0); + if (x < 0) { + debug(54, 0) ("sendto FD %d: %s\n", cwfd, xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: hello write test failed\n"); } + return x; +} + +static int __stdcall +ipc_thread_1(struct ipc_params *params) +{ + int retval = -1; + int t1, t2, t3; + int p2c[2] = { -1, -1 }; + int c2p[2] = { -1, -1 }; + HANDLE hProcess = NULL; + pid_t pid; + HANDLE thread = NULL; + struct thread_params thread_params; + int fd; + char *str; + int tmp_s; +#if HAVE_PUTENV + char *env_str = NULL; +#endif + int x; + int type = params->type; + int crfd = params->crfd; + int cwfd = params->cwfd; + int prfd_ipc = -1, pwfd_ipc = -1, crfd_ipc = -1, cwfd_ipc = -1; + char *prog = NULL; + char **args = params->args; + struct sockaddr_in PS = params->PS; + struct sockaddr_in CS_ipc, PS_ipc; + char *buf1 = NULL; + + buf1 = xcalloc(1, 8192); + strcpy(buf1, params->prog); + prog = strtok(buf1, w_space); + if ((str = strrchr(prog, '/'))) + prog = ++str; + if ((str = strrchr(prog, '\\'))) + prog = ++str; + prog = xstrdup(prog); +#else /* child */ no_suid(); /* give up extra priviliges */ /* close shared socket with parent */ @@ -220,39 +436,65 @@ if (pwfd != prfd) close(pwfd); pwfd = prfd = -1; +#endif if (type == IPC_TCP_SOCKET) { debug(54, 3) ("ipcCreate: calling accept on FD %d\n", crfd); if ((fd = accept(crfd, NULL, NULL)) < 0) { - debug(50, 0) ("ipcCreate: FD %d accept: %s\n", crfd, xstrerror()); + debug(54, 0) ("ipcCreate: FD %d accept: %s\n", crfd, xstrerror()); +#ifdef _SQUID_MSWIN_ + goto cleanup; +#else _exit(1); +#endif } debug(54, 3) ("ipcCreate: CHILD accepted new FD %d\n", fd); - close(crfd); +#ifdef _SQUID_MSWIN_ + comm_close(crfd); + snprintf(buf1, 8191, "%s CHILD socket", prog); + fd_open(fd, FD_SOCKET, buf1); + fd_table[fd].flags.ipc = 1; +#else + close(crfd); +#endif cwfd = crfd = fd; } else if (type == IPC_UDP_SOCKET) { if (comm_connect_addr(crfd, &PS) == COMM_ERROR) +#ifdef _SQUID_MSWIN_ + goto cleanup; +#else return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); +#endif } - if (type == IPC_UDP_SOCKET) { +#ifndef _SQUID_MSWIN_ + if (type == IPC_UDP_SOCKET) +#endif + { x = send(cwfd, hello_string, strlen(hello_string) + 1, 0); if (x < 0) { - debug(50, 0) ("sendto FD %d: %s\n", cwfd, xstrerror()); - debug(50, 0) ("ipcCreate: CHILD: hello write test failed\n"); + debug(54, 0) ("sendto FD %d: %s\n", cwfd, xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: hello write test failed\n"); +#ifdef _SQUID_MSWIN_ + goto cleanup; + } + } +#else _exit(1); } } else { if (write(cwfd, hello_string, strlen(hello_string) + 1) < 0) { - debug(50, 0) ("write FD %d: %s\n", cwfd, xstrerror()); - debug(50, 0) ("ipcCreate: CHILD: hello write test failed\n"); + debug(54, 0) ("write FD %d: %s\n", cwfd, xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: hello write test failed\n"); _exit(1); } } +#endif #if HAVE_PUTENV env_str = xcalloc((tmp_s = strlen(Config.debugOptions) + 32), 1); snprintf(env_str, tmp_s, "SQUID_DEBUG=%s", Config.debugOptions); putenv(env_str); #endif +#ifndef _SQUID_MSWIN_ /* * This double-dup stuff avoids problems when one of * crfd, cwfd, or debug_log are in the rage 0-2. @@ -287,4 +529,371 @@ debug(50, 0) ("ipcCreate: %s: %s\n", prog, xstrerror()); _exit(1); return 0; +#else + memset(buf1, '\0', sizeof(buf1)); + x = recv(crfd, buf1, 8191, 0); + if (x < 0) { + debug(54, 0) ("ipcCreate: CHILD: OK read test failed\n"); + debug(54, 0) ("--> read: %s\n", xstrerror()); + goto cleanup; + } else if (strcmp(buf1, ok_string)) { + debug(54, 0) ("ipcCreate: CHILD: OK read test failed\n"); + debug(54, 0) ("--> read returned %d\n", x); + debug(54, 0) ("--> got '%s'\n", rfc1738_escape(hello_buf)); + goto cleanup; + } + /* assign file descriptors to child process */ + if (_pipe(p2c, 1024, _O_BINARY | _O_NOINHERIT) < 0) { + debug(54, 0) ("ipcCreate: CHILD: pipe: %s\n", xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + if (_pipe(c2p, 1024, _O_BINARY | _O_NOINHERIT) < 0) { + debug(54, 0) ("ipcCreate: CHILD: pipe: %s\n", xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + if (type == IPC_UDP_SOCKET) { + snprintf(buf1, 8192, "%s(%ld) <-> ipc CHILD socket", prog, -1L); + crfd_ipc = cwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, 0, buf1); + + if (crfd_ipc < 0) { + debug(54, 0) ("ipcCreate: CHILD: Failed to create child FD for %s.\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + snprintf(buf1, 8192, "%s(%ld) <-> ipc PARENT socket", prog, -1L); + prfd_ipc = pwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, 0, buf1); + if (pwfd_ipc < 0) { + debug(54, 0) ("ipcCreate: CHILD: Failed to create server FD for %s.\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + tmp_s = sizeof(PS_ipc); + memset(&PS_ipc, '\0', tmp_s); + if (getsockname(pwfd_ipc, (struct sockaddr *) &PS_ipc, &tmp_s) < 0) { + debug(54, 0) ("ipcCreate: getsockname: %s\n", xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + debug(54, 3) ("ipcCreate: FD %d sockaddr %s:%d\n", + pwfd_ipc, inet_ntoa(PS_ipc.sin_addr), ntohs(PS_ipc.sin_port)); + tmp_s = sizeof(CS_ipc); + memset(&CS_ipc, '\0', tmp_s); + if (getsockname(crfd_ipc, (struct sockaddr *) &CS_ipc, &tmp_s) < 0) { + debug(54, 0) ("ipcCreate: getsockname: %s\n", xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + debug(54, 3) ("ipcCreate: FD %d sockaddr %s:%d\n", + crfd_ipc, inet_ntoa(CS_ipc.sin_addr), ntohs(CS_ipc.sin_port)); + + if (comm_connect_addr(pwfd_ipc, &CS_ipc) == COMM_ERROR) { + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + fd = crfd; + + if (comm_connect_addr(crfd_ipc, &PS_ipc) == COMM_ERROR) { + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + } /* IPC_UDP_SOCKET */ + t1 = dup(0); + t2 = dup(1); + t3 = dup(2); + dup2(c2p[0], 0); + dup2(p2c[1], 1); + dup2(fileno(debug_log), 2); + close(c2p[0]); + close(p2c[1]); + + commUnsetNonBlocking(fd); + + { + STARTUPINFO si; + PROCESS_INFORMATION pi; + long F; + + memset(&si, 0, sizeof(STARTUPINFO)); + si.cb = sizeof(STARTUPINFO); + si.hStdInput = (HANDLE) _get_osfhandle(0); + si.hStdOutput = (HANDLE) _get_osfhandle(1); + si.hStdError = (HANDLE) _get_osfhandle(2); + si.dwFlags = STARTF_USESTDHANDLES; + + /* Make sure all other valid handles are not inerithable */ + for (x = 3; x < SQUID_MAXFD; x++) { + if ((F = _get_osfhandle(x)) == -1) + continue; + SetHandleInformation((HANDLE) F, HANDLE_FLAG_INHERIT, 0); + } + + *buf1 = '\0'; + strcpy(buf1 + 4096, params->prog); + str = strtok(buf1 + 4096, w_space); + do { + strcat(buf1, str); + strcat(buf1, " "); + } while ((str = strtok(NULL, w_space))); + x = 1; + while (args[x]) { + strcat(buf1, args[x++]); + strcat(buf1, " "); + } + + if (CreateProcess(buf1 + 4096, buf1, NULL, NULL, TRUE, CREATE_NO_WINDOW, + NULL, NULL, &si, &pi)) { + pid = pi.dwProcessId; + hProcess = pi.hProcess; + } else { + pid = -1; + WIN32_maperror(GetLastError()); + x = errno; + } + } + dup2(t1, 0); + dup2(t2, 1); + dup2(t3, 2); + close(t1); + close(t2); + close(t3); + + if (pid == -1) { + errno = x; + debug(54, 0) ("ipcCreate: CHILD: %s: %s\n", params->prog, xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + if (type == IPC_UDP_SOCKET) { + WSAPROTOCOL_INFO wpi; + + memset(&wpi, 0, sizeof(wpi)); + if (SOCKET_ERROR == WSADuplicateSocket(crfd_ipc, pid, &wpi)) { + debug(54, 0) ("ipcCreate: CHILD: WSADuplicateSocket: %s\n", + xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + x = write(c2p[1], (const char *) &wpi, sizeof(wpi)); + if (x < sizeof(wpi)) { + debug(54, 0) ("ipcCreate: CHILD: write FD %d: %s\n", c2p[1], + xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + x = read(p2c[0], buf1, 8192); + if (x < 0) { + debug(54, 0) ("ipcCreate: CHILD: read FD %d: %s\n", p2c[0], + xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } else if (strncmp(buf1, ok_string, strlen(ok_string))) { + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + debug(54, 0) ("--> read returned %d\n", x); + buf1[x] = '\0'; + debug(54, 0) ("--> got '%s'\n", rfc1738_escape(buf1)); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + x = write(c2p[1], (const char *) &PS_ipc, sizeof(PS_ipc)); + if (x < sizeof(PS_ipc)) { + debug(54, 0) ("ipcCreate: CHILD: write FD %d: %s\n", c2p[1], + xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + x = read(p2c[0], buf1, 8192); + if (x < 0) { + debug(54, 0) ("ipcCreate: CHILD: read FD %d: %s\n", p2c[0], + xstrerror()); + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } else if (strncmp(buf1, ok_string, strlen(ok_string))) { + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); + debug(54, 0) ("--> read returned %d\n", x); + buf1[x] = '\0'; + debug(54, 0) ("--> got '%s'\n", rfc1738_escape(buf1)); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + x = send(pwfd_ipc, ok_string, strlen(ok_string), 0); + x = recv(prfd_ipc, buf1 + 200, 8191 - 200, 0); + assert((size_t) x == strlen(ok_string) + && !strncmp(ok_string, buf1 + 200, strlen(ok_string))); + } /* IPC_UDP_SOCKET */ + snprintf(buf1, 8191, "%s(%ld) CHILD socket", prog, (long int)pid); + fd_note(fd, buf1); + if (prfd_ipc != -1) { + snprintf(buf1, 8191, "%s(%ld) <-> ipc CHILD socket", prog, (long int)pid); + fd_note(crfd_ipc, buf1); + snprintf(buf1, 8191, "%s(%ld) <-> ipc PARENT socket", prog, (long int)pid); + fd_note(prfd_ipc, buf1); + } /* else { // IPC_TCP_SOCKET + * commSetNoLinger(fd); + * } + */ + thread_params.prog = prog; + thread_params.send_fd = cwfd; + thread_params.pid = pid; + if ((thread_params.type = type) == IPC_TCP_SOCKET) + thread_params.rfd = p2c[0]; + else + thread_params.rfd = prfd_ipc; + + thread = + (HANDLE) _beginthreadex(NULL, 0, ipc_thread_2, &thread_params, 0, NULL); + if (!thread) { + debug(54, 0) ("ipcCreate: CHILD: _beginthreadex: %s\n", xstrerror()); + ipcSend(cwfd, err_string, strlen(err_string)); + goto cleanup; + } + + snprintf(buf1, 8191, "%ld\n", (long int)pid); + if (-1 == ipcSend(cwfd, buf1, strlen(buf1))) + goto cleanup; + + debug(54, 2) ("ipc(%s,%ld): started successfully\n", prog, (long int)pid); + /* cycle */ + for (;;) { + x = recv(crfd, buf1, 8192, 0); + if (x <= 0) { + debug(54, 3) ("ipc(%s,%d): %d bytes received from parent. Exiting...\n", + prog, pid, x); + break; + } + buf1[x] = '\0'; + if (type == IPC_UDP_SOCKET && !strcmp(buf1, shutdown_string)) { + debug(54, 3) + ("ipc(%s,%d): request for shutdown received from parent. Exiting...\n", + prog, pid); + TerminateProcess(hProcess, 0); + break; + } + debug(54, 5) ("ipc(%s,%d): received from parent: %s\n", prog, pid, + rfc1738_escape_unescaped(buf1)); + if (type == IPC_TCP_SOCKET) + x = write(c2p[1], buf1, x); + else + x = send(pwfd_ipc, buf1, x, 0); + if (x <= 0) { + debug(54, 3) ("ipc(%s,%d): %d bytes written to %s. Exiting...\n", + prog, pid, x, prog); + break; + } + } + + retval = 0; + + cleanup: + if (c2p[1] != -1) + close(c2p[1]); + if (fd_table[crfd].flags.open) + ipcCloseAllFD(-1, -1, crfd, cwfd); + if (prfd_ipc != -1) { + send(crfd_ipc, shutdown_string, strlen(shutdown_string), 0); + shutdown(crfd_ipc, SD_BOTH); + shutdown(prfd_ipc, SD_BOTH); + } + ipcCloseAllFD(prfd_ipc, pwfd_ipc, crfd_ipc, cwfd_ipc); + if (hProcess && WAIT_OBJECT_0 != + WaitForSingleObject(hProcess, type == IPC_UDP_SOCKET ? 12000 : 5000)) { + + getCurrentTime(); + debug(54, 0) ("ipc(%s,%d): WARNING: %s didn't exit in %d seconds.\n", + prog, pid, prog, type == IPC_UDP_SOCKET ? 12 : 5); + } + if (thread && WAIT_OBJECT_0 != WaitForSingleObject(thread, 3000)) { + getCurrentTime(); + debug(54, 0) + ("ipc(%s,%d): WARNING: ipc_thread_2 didn't exit in 3 seconds.\n", + prog, pid); + } + getCurrentTime(); + if (!retval) + debug(54, 2) ("ipc(%s,%d): normal exit\n", prog, pid); + + if (buf1) + xfree(buf1); + if (prog) + xfree(prog); + if (env_str) + xfree(env_str); + if (thread) + CloseHandle(thread); + if (hProcess) + CloseHandle(hProcess); + if (p2c[0] != -1) + close(p2c[0]); + return retval; +#endif +} + +#ifdef _SQUID_MSWIN_ +static int __stdcall +ipc_thread_2(struct thread_params *params) +{ + int type = params->type; + int rfd = params->rfd; + int send_fd = params->send_fd; + int x; + char *prog = xstrdup(params->prog); + pid_t pid = params->pid; + char *buf2 = xcalloc(1, 8192); + + for (;;) { + if (type == IPC_TCP_SOCKET) + x = read(rfd, buf2, 8192); + else + x = recv(rfd, buf2, 8192, 0); + if ((x <= 0 && type == IPC_TCP_SOCKET) || + (x < 0 && type == IPC_UDP_SOCKET)) { + debug(54, 3) ("ipc(%s,%d): %d bytes read from %s. Exiting...\n", + prog, pid, x, prog); + break; + } + buf2[x] = '\0'; + if (type == IPC_UDP_SOCKET && !strcmp(buf2, shutdown_string)) { + debug(54, 3) ("ipc(%s,%d): request for shutdown received. Exiting...\n", + prog, pid); + break; + } + if (x >= 2) { + if ((buf2[x-1] == '\n') && (buf2[x-2] == '\r')) { + buf2[x-2] = '\n'; + buf2[x-1] = '\0'; + x--; + } + } + debug(54, 5) ("ipc(%s,%d): received from child : %s\n", prog, pid, + rfc1738_escape_unescaped(buf2)); + x = send(send_fd, buf2, x, 0); + if ((x <= 0 && type == IPC_TCP_SOCKET) || + (x < 0 && type == IPC_UDP_SOCKET)) { + debug(54, 3) ("ipc(%s,%d): %d bytes sent to parent. Exiting...\n", + prog, pid, x); + break; + } + } + xfree(prog); + xfree(buf2); + return 0; } +#endif Index: squid/src/main.c diff -u squid/src/main.c:1.28.6.25 squid/src/main.c:1.28.6.1.4.33 --- squid/src/main.c:1.28.6.25 Mon Jun 27 19:16:51 2005 +++ squid/src/main.c Wed Jun 29 13:16:30 2005 @@ -35,9 +35,25 @@ #include "squid.h" +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) +#include +#include +static int opt_install_service = FALSE; +static int opt_remove_service = FALSE; +static int opt_signal_service = FALSE; +static int opt_command_line = FALSE; +extern void WIN32_svcstatusupdate(DWORD, DWORD); +void WINAPI WIN32_svcHandler(DWORD); +#endif + /* for error reporting from xmalloc and friends */ extern void (*failure_notify) (const char *); +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) +static int opt_no_daemon = 1; +#else +static int opt_no_daemon = 0; +#endif static int opt_parse_cfg_only = 0; static char *opt_syslog_facility = NULL; static int httpPortNumOverride = 1; @@ -52,8 +68,6 @@ static void mainRotate(void); static void mainReconfigure(void); -static SIGHDLR rotate_logs; -static SIGHDLR reconfigure; #if ALARM_UPDATES_TIME static SIGHDLR time_tick; #endif @@ -72,7 +86,9 @@ static void mainSetCwd(void); static int checkRunningPid(void); +#ifndef _SQUID_MSWIN_ static const char *squid_start_script = "squid_start"; +#endif #if TEST_ACCESS #include "test_access.c" @@ -82,15 +98,27 @@ usage(void) { fprintf(stderr, +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + "Usage: %s [-dhirvzCDFRVYX] [-s | -l facility] [-f config-file] [-[au] port] [-k signal] [-n name] [-O CommandLine]\n" +#else "Usage: %s [-dhvzCDFNRVYX] [-s | -l facility] [-f config-file] [-[au] port] [-k signal]\n" +#endif " -a port Specify HTTP port number (default: %d).\n" " -d level Write debugging to stderr also.\n" " -f file Use given config-file instead of\n" " %s\n" " -h Print help message.\n" +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + " -i Installs as a Windows Service (see -n option).\n" +#endif " -k reconfigure|rotate|shutdown|interrupt|kill|debug|check|parse\n" " Parse configuration file, then send signal to \n" " running copy (except -k parse) and exit.\n" +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + " -n name Specify Windows Service name to use for service operations\n" + " default is: " _WIN_SQUID_DEFAULT_SERVICE_NAME ".\n" + " -r Removes a Windows Service (see -n option).\n" +#endif " -s | -l facility\n" " Enable logging to syslog.\n" " -u port Specify ICP port number (default: %d), disable with 0.\n" @@ -99,7 +127,12 @@ " -C Do not catch fatal signals.\n" " -D Disable initial DNS tests.\n" " -F Don't serve any requests until store is rebuilt.\n" +#if !(defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) " -N No daemon mode.\n" +#else + " -O options\n" + " Set Windows Service Command line options in Registry.\n" +#endif " -R Do not set REUSEADDR on port.\n" " -S Double-check swap during rebuild.\n" " -V Virtual host httpd-accelerator.\n" @@ -115,7 +148,11 @@ extern char *optarg; int c; +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + while ((c = getopt(argc, argv, "CDFO:RSVYXa:d:f:hik:m::n:rsl:u:vz?")) != -1) { +#else while ((c = getopt(argc, argv, "CDFNRSVYXa:d:f:hk:m::sl:u:vz?")) != -1) { +#endif switch (c) { case 'C': opt_catch_signals = 0; @@ -126,9 +163,16 @@ case 'F': opt_foreground_rebuild = 1; break; +#if !(defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) case 'N': opt_no_daemon = 1; break; +#else + case 'O': + opt_command_line = 1; + WIN32_Command_Line = xstrdup(optarg); + break; +#endif case 'R': opt_reuseaddr = 0; break; @@ -158,6 +202,11 @@ case 'h': usage(); break; +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + case 'i': + opt_install_service = TRUE; + break; +#endif case 'k': if ((int) strlen(optarg) < 1) usage(); @@ -205,6 +254,16 @@ fatal("Need to configure --enable-xmalloc-debug-trace to use -m option"); #endif } +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + case 'n': + xfree(WIN32_Service_name); + WIN32_Service_name = xstrdup(optarg); + opt_signal_service = TRUE; + break; + case 'r': + opt_remove_service = TRUE; + break; +#endif case 'l': opt_syslog_facility = xstrdup(optarg); case 's': @@ -222,6 +281,9 @@ break; case 'v': printf("Squid Cache: Version %s\nconfigure options: %s\n", version_string, SQUID_CONFIGURE_OPTIONS); +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + printf("Compiled as Windows System Service.\n"); +#endif exit(0); /* NOTREACHED */ case 'z': @@ -236,13 +298,15 @@ } /* ARGSUSED */ -static void +void rotate_logs(int sig) { do_rotate = 1; +#ifndef _SQUID_MSWIN_ #if !HAVE_SIGACTION signal(sig, rotate_logs); #endif +#endif } #if ALARM_UPDATES_TIME @@ -259,19 +323,22 @@ #endif /* ARGSUSED */ -static void +void reconfigure(int sig) { do_reconfigure = 1; +#ifndef _SQUID_MSWIN_ #if !HAVE_SIGACTION signal(sig, reconfigure); #endif +#endif } void shut_down(int sig) { do_shutdown = sig == SIGINT ? -1 : 1; +#ifndef _SQUID_MSWIN_ #ifdef KILL_PARENT_OPT if (getppid() > 1) { debug(1, 1) ("Killing RunCache, pid %ld\n", (long) getppid()); @@ -283,6 +350,7 @@ signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); #endif +#endif } static void @@ -493,8 +561,21 @@ debug(1, 0) ("Starting Squid Cache version %s for %s...\n", version_string, CONFIG_HOST_TYPE); +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + debug(1, 0) ("Running as %s Windows System Service on %s\n", WIN32_Service_name, WIN32_OS_string); + debug(1, 0) ("Service command line is: %s\n", WIN32_Service_Command_Line); + } + else + debug(1, 0) ("Running on %s\n",WIN32_OS_string); +#endif debug(1, 1) ("Process ID %d\n", (int) getpid()); debug(1, 1) ("With %d file descriptors available\n", Squid_MaxFD); +#ifdef _SQUID_MSWIN_ + debug(1, 1) ("With %d CRT stdio descriptors available\n", _getmaxstdio()); + if (WIN32_Socks_initialized) + debug(1, 1)("Windows sockets initialized\n"); +#endif if (!configured_once) disk_init(); /* disk_init must go before ipcache_init() */ @@ -585,15 +666,18 @@ configured_once = 1; } +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) +/* When USE_WIN32_SERVICE is defined, the main function is placed in win32.c */ +void WINAPI +SquidMain(int argc, char **argv) +#else int main(int argc, char **argv) +#endif { int errcount = 0; int loop_delay; mode_t oldmask; -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) - int WIN32_init_err; -#endif #if HAVE_SBRK sbrk_start = sbrk(0); @@ -604,8 +688,16 @@ Squid_MaxFD = FD_SETSIZE; #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) - if ((WIN32_init_err = WIN32_Subsystem_Init())) - return WIN32_init_err; +#ifdef USE_WIN32_SERVICE + if (WIN32_Subsystem_Init(&argc, &argv)) + return; +#else + { + int WIN32_init_err; + if ((WIN32_init_err = WIN32_Subsystem_Init())) + return WIN32_init_err; + } +#endif #endif /* call mallopt() before anything else */ @@ -646,8 +738,26 @@ squid_start = current_time; failure_notify = fatal_dump; +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_START_PENDING, 10000); +#endif mainParseOptions(argc, argv); +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + if (opt_install_service) { + WIN32_InstallService(); + return; + } + if (opt_remove_service) { + WIN32_RemoveService(); + return; + } + if (opt_command_line) { + WIN32_SetServiceCommandLine(); + return; + } +#endif + /* parse configuration file * note: in "normal" case this used to be called from mainInitialize() */ { @@ -666,7 +776,11 @@ parse_err = parseConfigFile(ConfigFile); if (opt_parse_cfg_only) +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + return; +#else return parse_err; +#endif } if (-1 == opt_send_signal) if (checkRunningPid()) @@ -701,7 +815,11 @@ setEffectiveUser(); debug(0, 0) ("Creating Swap Directories\n"); storeCreateSwapDirectories(); +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + return; +#else return 0; +#endif } if (!opt_no_daemon) watch_child(argv); @@ -717,13 +835,25 @@ fd_open(1, FD_LOG, "stdout"); fd_open(2, FD_LOG, "stderr"); } +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_START_PENDING, 10000); +#endif mainInitialize(); +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_RUNNING, 0); +#endif + /* main loop */ for (;;) { if (do_reconfigure) { mainReconfigure(); do_reconfigure = 0; +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) + } else if (do_debug) { + do_debug = 0; + __asm int 3; +#endif } else if (do_rotate) { mainRotate(); do_rotate = 0; @@ -735,6 +865,9 @@ (int) wait); do_shutdown = 0; shutting_down = 1; +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_STOP_PENDING, (wait + 1) * 1000); +#endif serverConnectionsClose(); eventAdd("SquidShutdown", SquidShutdown, NULL, (double) (wait + 1), 1); } @@ -766,7 +899,11 @@ } } /* NOTREACHED */ +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + return; +#else return 0; +#endif } static void @@ -776,14 +913,28 @@ debug_log = stderr; pid = readPidFile(); if (pid > 1) { +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + if (opt_signal_service) + WIN32_sendSignal(opt_send_signal); + else { +#endif +#if defined(_SQUID_MSWIN_) && defined(USE_WIN32_SERVICE) + fprintf(stderr, "%s: ERROR: Could not send ", appname); + fprintf(stderr, "signal to Squid Service:\n"); + fprintf(stderr, "missing -n command line switch.\n"); +#else if (kill(pid, opt_send_signal) && /* ignore permissions if just running check */ !(opt_send_signal == 0 && errno == EPERM)) { fprintf(stderr, "%s: ERROR: Could not send ", appname); fprintf(stderr, "signal %d to process %d: %s\n", opt_send_signal, (int) pid, xstrerror()); +#endif exit(1); } +#if defined(USE_WIN32_SERVICE) && defined(_SQUID_CYGWIN_) + } +#endif } else { fprintf(stderr, "%s: ERROR: No running copy\n", appname); exit(1); @@ -792,6 +943,7 @@ exit(0); } +#ifndef _SQUID_MSWIN_ /* * This function is run when Squid is in daemon mode, just * before the parent forks and starts up the child process. @@ -828,6 +980,7 @@ } while (rpid != cpid); } } +#endif static int checkRunningPid(void) @@ -850,6 +1003,7 @@ static void watch_child(char *argv[]) { +#ifndef _SQUID_MSWIN_ char *prog; int failcount = 0; time_t start; @@ -952,11 +1106,15 @@ sleep(3); } /* NOTREACHED */ +#endif } static void SquidShutdown(void *unused) { +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_STOP_PENDING, 10000); +#endif debug(1, 1) ("Shutting down...\n"); #if USE_DNSSERVERS dnsShutdown(); @@ -981,6 +1139,9 @@ #if USE_UNLINKD unlinkdClose(); #endif +#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) + WIN32_svcstatusupdate(SERVICE_STOP_PENDING, 10000); +#endif storeDirSync(); /* Flush pending object writes/unlinks */ storeDirWriteCleanLogs(0); PrintRusage(); Index: squid/src/mime.c diff -u squid/src/mime.c:1.11.6.5 squid/src/mime.c:1.11.14.6 --- squid/src/mime.c:1.11.6.5 Fri Mar 25 19:15:58 2005 +++ squid/src/mime.c Sat Mar 26 01:48:39 2005 @@ -302,7 +302,7 @@ debug(25, 1) ("mimeInit: %s: %s\n", filename, xstrerror()); return; } -#if defined (_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) setmode(fileno(fp), O_TEXT); #endif mimeFreeMemory(); Index: squid/src/neighbors.c diff -u squid/src/neighbors.c:1.14.6.6 squid/src/neighbors.c:1.14.14.7 --- squid/src/neighbors.c:1.14.6.6 Thu Mar 10 06:12:06 2005 +++ squid/src/neighbors.c Fri Mar 11 06:14:59 2005 @@ -1099,7 +1099,7 @@ return ret; /* probe already running */ if (squid_curtime - p->stats.last_connect_probe == 0) return ret; /* don't probe to often */ - fd = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL), + fd = comm_open(SOCK_STREAM, IPPROTO_TCP, getOutgoingAddr(NULL), 0, COMM_NONBLOCKING, p->host); if (fd < 0) return ret; Index: squid/src/net_db.c diff -u squid/src/net_db.c:1.11.22.8 squid/src/net_db.c:1.11.28.10 --- squid/src/net_db.c:1.11.22.8 Fri Sep 16 19:13:12 2005 +++ squid/src/net_db.c Mon Sep 19 09:23:08 2005 @@ -435,15 +435,19 @@ * Solaris bugs, its a bad idea. fopen can fail if more than * 256 FDs are open. */ +#ifdef _SQUID_MSWIN_ + fd = file_open(path, O_RDONLY | O_BINARY); +#else fd = file_open(path, O_RDONLY | O_TEXT); +#endif if (fd < 0) return; if (fstat(fd, &sb) < 0) { file_close(fd); return; } - t = buf = xcalloc(1, sb.st_size + 1); - l = FD_READ_METHOD(fd, buf, sb.st_size); + t = buf = xcalloc(1, (size_t) sb.st_size + 1); + l = FD_READ_METHOD(fd, buf, (size_t) sb.st_size); file_close(fd); if (l <= 0) return; Index: squid/src/pinger.c diff -u squid/src/pinger.c:1.4.66.1 squid/src/pinger.c:1.4.74.9 --- squid/src/pinger.c:1.4.66.1 Tue Dec 23 19:14:13 2003 +++ squid/src/pinger.c Wed Dec 24 01:49:15 2003 @@ -37,19 +37,92 @@ #if USE_ICMP +/* Native Windows port doesn't have netinet support, so we emulate it. + At this time, Cygwin lacks icmp support in its include files, so we need + to use the native Windows port definitions. + */ + +#if !defined(_SQUID_MSWIN_) && !defined(_SQUID_CYGWIN_) + #include #include #include #include +#define PINGER_TIMEOUT 10 + +static int socket_from_squid = 0; +static int socket_to_squid = 1; + +#else /* _SQUID_MSWIN_ or _SQUID_CYGWIN_ */ + +#ifdef _SQUID_MSWIN_ + +#include +#include + +#define PINGER_TIMEOUT 5 + +static SOCKET socket_to_squid = -1; +#define socket_from_squid socket_to_squid + +#else /* _SQUID_CYGWIN_ */ + +#include +#include +#include +#include + +#define PINGER_TIMEOUT 10 + +static int socket_from_squid = 0; +static int socket_to_squid = 1; + +#endif + +#define ICMP_ECHO 8 +#define ICMP_ECHOREPLY 0 + +typedef struct iphdr +{ + u_int8_t ip_vhl:4; /* Length of the header in dwords */ + u_int8_t version:4; /* Version of IP */ + u_int8_t tos; /* Type of service */ + u_int16_t total_len; /* Length of the packet in dwords */ + u_int16_t ident; /* unique identifier */ + u_int16_t flags; /* Flags */ + u_int8_t ip_ttl; /* Time to live */ + u_int8_t proto; /* Protocol number (TCP, UDP etc) */ + u_int16_t checksum; /* IP checksum */ + u_int32_t source_ip; + u_int32_t dest_ip; +} +iphdr; + +/* ICMP header */ +typedef struct icmphdr +{ + u_int8_t icmp_type; /* ICMP packet type */ + u_int8_t icmp_code; /* Type sub code */ + u_int16_t icmp_cksum; + u_int16_t icmp_id; + u_int16_t icmp_seq; + u_int32_t timestamp; /* not part of ICMP, but we need it */ +} +icmphdr; + +#endif /* _SQUID_MSWIN_ */ + #ifndef _SQUID_LINUX_ #ifndef _SQUID_CYGWIN_ +#ifndef _SQUID_MSWIN_ #define icmphdr icmp #define iphdr ip #endif #endif +#endif -#if defined (_SQUID_LINUX_) || defined (_SQUID_CYGWIN_) +#if defined (_SQUID_LINUX_) #ifdef icmp_id #undef icmp_id #endif @@ -118,28 +191,100 @@ static void pingerLog(struct icmphdr *, struct in_addr, int, int); static int ipHops(int ttl); static void pingerSendtoSquid(pingerReplyData * preply); +static void pingerOpen(void); +static void pingerClose(void); void pingerOpen(void) { struct protoent *proto = NULL; +#ifdef _SQUID_MSWIN_ + WSADATA wsaData; + WSAPROTOCOL_INFO wpi; + char buf[sizeof(wpi)]; + int x; + struct sockaddr_in PS; + + WSAStartup(2, &wsaData); + + getCurrentTime(); + _db_init(NULL, "ALL,1"); + setmode(0, O_BINARY); + setmode(1, O_BINARY); + x = read(0, buf, sizeof(wpi)); + if (x < sizeof(wpi)) { + getCurrentTime(); + debug(42, 0) ("pingerOpen: read: FD 0: %s\n", xstrerror()); + write(1, "ERR\n", 4); + exit(1); + } + xmemcpy(&wpi, buf, sizeof(wpi)); + + write(1, "OK\n", 3); + x = read(0, buf, sizeof(PS)); + if (x < sizeof(PS)) { + getCurrentTime(); + debug(42, 0) ("pingerOpen: read: FD 0: %s\n", xstrerror()); + write(1, "ERR\n", 4); + exit(1); + } + xmemcpy(&PS, buf, sizeof(PS)); +#endif if ((proto = getprotobyname("icmp")) == 0) { debug(42, 0) ("pingerOpen: unknown protocol: icmp\n"); exit(1); } icmp_sock = socket(PF_INET, SOCK_RAW, proto->p_proto); if (icmp_sock < 0) { - debug(50, 0) ("pingerOpen: icmp_sock: %s\n", xstrerror()); + debug(42, 0) ("pingerOpen: icmp_sock: %s\n", xstrerror()); exit(1); } icmp_ident = getpid() & 0xffff; debug(42, 0) ("pinger: ICMP socket opened\n"); +#ifdef _SQUID_MSWIN_ + socket_to_squid = + WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, + &wpi, 0, 0); + if (socket_to_squid == -1) { + getCurrentTime(); + debug(42, 0) ("pingerOpen: WSASocket: %s\n", xstrerror()); + write(1, "ERR\n", 4); + exit(1); + } + x = connect(socket_to_squid, (struct sockaddr *) &PS, sizeof(PS)); + if (SOCKET_ERROR == x) { + getCurrentTime(); + debug(42, 0) ("pingerOpen: connect: %s\n", xstrerror()); + write(1, "ERR\n", 4); + exit(1); + } + write(1, "OK\n", 3); + memset(buf, 0, sizeof(buf)); + x = recv(socket_to_squid, buf, sizeof(buf), 0); + if (x < 3) { + debug(42, 0) ("icmpOpen: recv: %s\n", xstrerror()); + exit(1); + } + x = send(socket_to_squid, buf, strlen(buf), 0); + if (x < 3 || strncmp("OK\n", buf, 3)) { + debug(42, 0) ("icmpOpen: recv: %s\n", xstrerror()); + exit(1); + } + + getCurrentTime(); + debug(42, 0) ("pinger: Squid socket opened\n"); +#endif } void pingerClose(void) { close(icmp_sock); +#ifdef _SQUID_MSWIN_ + shutdown(socket_to_squid, SD_BOTH); + close(socket_to_squid); + socket_to_squid = -1; +#endif icmp_sock = -1; icmp_ident = 0; } @@ -267,7 +412,7 @@ } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); - answer = ~sum; + answer = (unsigned short) ~sum; return (answer); } @@ -307,7 +452,7 @@ int n; int guess_size; memset(&pecho, '\0', sizeof(pecho)); - n = recv(0, (char *) &pecho, sizeof(pecho), 0); + n = recv(socket_from_squid, (char *) &pecho, sizeof(pecho), 0); if (n < 0) return n; if (0 == n) { @@ -334,8 +479,9 @@ pingerSendtoSquid(pingerReplyData * preply) { int len = sizeof(pingerReplyData) - MAX_PKT_SZ + preply->psize; - if (send(1, (char *) preply, len, 0) < 0) { - debug(50, 0) ("pinger: send: %s\n", xstrerror()); + if (send(socket_to_squid, (char *) preply, len, 0) < 0) { + debug(42, 0) ("pinger: send: %s\n", xstrerror()); + pingerClose(); exit(1); } } @@ -376,25 +522,34 @@ _db_init(NULL, debug_args); for (;;) { - tv.tv_sec = 10; + tv.tv_sec = PINGER_TIMEOUT; tv.tv_usec = 0; FD_ZERO(&R); - FD_SET(0, &R); + FD_SET(socket_from_squid, &R); FD_SET(icmp_sock, &R); x = select(icmp_sock + 1, &R, NULL, NULL, &tv); getCurrentTime(); - if (x < 0) + if (x < 0) { + pingerClose(); exit(1); - if (FD_ISSET(0, &R)) + } + if (FD_ISSET(socket_from_squid, &R)) if (pingerReadRequest() < 0) { debug(42, 0) ("Pinger exiting.\n"); + pingerClose(); exit(1); } if (FD_ISSET(icmp_sock, &R)) pingerRecv(); - if (10 + last_check_time < squid_curtime) { - if (send(1, (char *) &tv, 0, 0) < 0) + if (PINGER_TIMEOUT + last_check_time < squid_curtime) { + debug(42,5) ("pinger: timeout occured\n"); + if (send(socket_to_squid, (char *) &tv, 0, 0) < 0) { + debug(42,5) ("Pinger: send socket_to_squid failed\n"); + pingerClose(); exit(1); + } else { + debug(42,5) ("Pinger: send socket_to_squid OK\n"); + } last_check_time = squid_curtime; } } Index: squid/src/protos.h diff -u squid/src/protos.h:1.41.6.34 squid/src/protos.h:1.41.6.3.4.37 --- squid/src/protos.h:1.41.6.34 Sat Feb 25 19:13:57 2006 +++ squid/src/protos.h Sun Feb 26 01:14:43 2006 @@ -778,6 +778,8 @@ extern void serverConnectionsClose(void); extern void shut_down(int); +extern void rotate_logs(int); +extern void reconfigure(int); extern void start_announce(void *unused); @@ -1200,7 +1202,11 @@ const char *const args[], const char *name, int *rfd, - int *wfd); + int *wfd +#ifdef _SQUID_MSWIN_ + , HANDLE * hIpc, pid_t * ppid +#endif +); /* CacheDigest */ extern CacheDigest *cacheDigestCreate(int capacity, int bpe); @@ -1322,8 +1328,20 @@ /* CygWin & Windows NT Port */ /* win32.c */ #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef USE_WIN32_SERVICE +extern int WIN32_Subsystem_Init(int *, char ***); +#else extern int WIN32_Subsystem_Init(void); +#endif +extern void WIN32_sendSignal(int); +extern void WIN32_Abort(int); extern void WIN32_Exit(void); +extern void WIN32_SetServiceCommandLine(void); +extern void WIN32_InstallService(void); +extern void WIN32_RemoveService(void); +extern int WIN32_pipe(int[2]); +extern int WIN32_getrusage(int, struct rusage *); +void WIN32_ExceptionHandlerInit(void); #endif /* external_acl.c */ Index: squid/src/snmp_core.c diff -u squid/src/snmp_core.c:1.8.12.6 squid/src/snmp_core.c:1.8.12.2.4.5 --- squid/src/snmp_core.c:1.8.12.6 Sun Jun 19 19:14:57 2005 +++ squid/src/snmp_core.c Fri Jun 24 03:08:24 2005 @@ -355,7 +355,7 @@ if ((port = Config.Port.snmp) > (u_short) 0) { enter_suid(); theInSnmpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.snmp_incoming, port, COMM_NONBLOCKING, @@ -369,7 +369,7 @@ if (Config.Addrs.snmp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); theOutSnmpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.snmp_outgoing, port, COMM_NONBLOCKING, Index: squid/src/squid.h diff -u squid/src/squid.h:1.13.6.9 squid/src/squid.h:1.13.6.2.4.13 --- squid/src/squid.h:1.13.6.9 Fri Mar 10 19:16:31 2006 +++ squid/src/squid.h Sat Mar 11 06:07:46 2006 @@ -208,7 +208,7 @@ #if HAVE_LIMITS_H #include #endif -#if defined(_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) #include #endif @@ -477,6 +477,24 @@ #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len) #define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len) +#ifndef IPPROTO_UDP +#define IPPROTO_UDP 0 +#endif + +#ifndef IPPROTO_TCP +#define IPPROTO_TCP 0 +#endif + +#if defined(_SQUID_MSWIN_) +/* Windows lacks getpagesize() prototype */ +#ifndef getpagesize +extern size_t getpagesize(void); +#endif +#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ +#define strtoll WIN32_strtoll +#endif +#endif /* _SQUID_MSWIN_ */ + /* * Trap attempts to build large file cache support without support for * large objects Index: squid/src/ssl.c diff -u squid/src/ssl.c:1.13.6.13 squid/src/ssl.c:1.13.14.14 --- squid/src/ssl.c:1.13.6.13 Fri Mar 10 19:16:31 2006 +++ squid/src/ssl.c Sat Mar 11 06:07:46 2006 @@ -518,7 +518,7 @@ statCounter.server.other.requests++; /* Create socket. */ sock = comm_openex(SOCK_STREAM, - 0, + IPPROTO_TCP, getOutgoingAddr(request), 0, COMM_NONBLOCKING, Index: squid/src/ssl_support.c diff -u squid/src/ssl_support.c:1.6.6.3 squid/src/ssl_support.c:1.6.14.4 --- squid/src/ssl_support.c:1.6.6.3 Thu Dec 11 19:13:43 2003 +++ squid/src/ssl_support.c Sat Dec 13 01:46:57 2003 @@ -35,6 +35,7 @@ #include "squid.h" +#if USE_SSL extern int commUnsetNonBlocking(int fd); extern int commSetNonBlocking(int fd); @@ -401,3 +402,4 @@ } SSL_shutdown(ssl); } +#endif Index: squid/src/ssl_support.h diff -u squid/src/ssl_support.h:1.5 squid/src/ssl_support.h:1.5.14.2 --- squid/src/ssl_support.h:1.5 Fri Oct 19 15:48:48 2001 +++ squid/src/ssl_support.h Tue Mar 29 23:29:46 2005 @@ -48,4 +48,10 @@ int ssl_write_method(int, const char *, int); void ssl_shutdown_method(int); +#ifdef _SQUID_MSWIN_ + +#define SSL_set_fd(s,f) (SSL_set_fd(s,fd_table[fd].win32.handle)) + +#endif /* _SQUID_MSWIN_ */ + #endif /* SQUID_SSL_SUPPORT_H */ Index: squid/src/stat.c diff -u squid/src/stat.c:1.13.6.14 squid/src/stat.c:1.13.10.15 --- squid/src/stat.c:1.13.6.14 Tue Mar 29 18:17:46 2005 +++ squid/src/stat.c Tue Mar 29 23:21:26 2005 @@ -442,21 +442,37 @@ int i; fde *f; storeAppendPrintf(sentry, "Active file descriptors:\n"); +#ifdef _SQUID_MSWIN_ + storeAppendPrintf(sentry, "%-4s %-10s %-6s %-4s %-7s* %-7s* %-21s %s\n", + "File", + "Handle", +#else storeAppendPrintf(sentry, "%-4s %-6s %-4s %-7s* %-7s* %-21s %s\n", "File", +#endif "Type", "Tout", "Nread", "Nwrite", "Remote Address", "Description"); +#ifdef _SQUID_MSWIN_ + storeAppendPrintf(sentry, "---- ---------- ------ ---- -------- -------- --------------------- ------------------------------\n"); +#else storeAppendPrintf(sentry, "---- ------ ---- -------- -------- --------------------- ------------------------------\n"); +#endif for (i = 0; i < Squid_MaxFD; i++) { f = &fd_table[i]; if (!f->flags.open) continue; +#ifdef _SQUID_MSWIN_ + storeAppendPrintf(sentry, "%4d 0x%-8lX %-6.6s %4d %7" PRINTF_OFF_T "%c %7" PRINTF_OFF_T "%c %-21s %s\n", + i, + f->win32.handle, +#else storeAppendPrintf(sentry, "%4d %-6.6s %4d %7" PRINTF_OFF_T "%c %7" PRINTF_OFF_T "%c %-21s %s\n", i, +#endif fdTypeStr[f->type], f->timeout_handler ? (int) (f->timeout - squid_curtime) / 60 : 0, f->bytes_read, @@ -486,6 +502,15 @@ runtime = 1.0; storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n", version_string); +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + storeAppendPrintf(sentry,"\nRunning as %s Windows System Service on %s\n", + WIN32_Service_name, WIN32_OS_string); + storeAppendPrintf(sentry,"Service command line is: %s\n", WIN32_Service_Command_Line); + } + else + storeAppendPrintf(sentry,"Running on %s\n",WIN32_OS_string); +#endif storeAppendPrintf(sentry, "Start Time:\t%s\n", mkrfc1123(squid_start.tv_sec)); storeAppendPrintf(sentry, "Current Time:\t%s\n", Index: squid/src/store_dir.c diff -u squid/src/store_dir.c:1.19.6.3 squid/src/store_dir.c:1.19.14.7 --- squid/src/store_dir.c:1.19.6.3 Fri Mar 25 19:15:59 2005 +++ squid/src/store_dir.c Sat Mar 26 01:48:59 2005 @@ -78,14 +78,19 @@ { int i; SwapDir *sd; +#ifndef _SQUID_MSWIN_ pid_t pid; int status; +#endif for (i = 0; i < Config.cacheSwap.n_configured; i++) { +#ifndef _SQUID_MSWIN_ if (fork()) continue; +#endif sd = &Config.cacheSwap.swapDirs[i]; if (NULL != sd->newfs) sd->newfs(sd); +#ifndef _SQUID_MSWIN_ exit(0); } do { @@ -95,6 +100,9 @@ pid = waitpid(-1, &status, 0); #endif } while (pid > 0 || (pid < 0 && errno == EINTR)); +#else + } +#endif } /* @@ -266,7 +274,7 @@ e->swap_dirn, e->swap_filen); sd = &Config.cacheSwap.swapDirs[e->swap_dirn]; - sd->log.write(sd, e, op); + (sd->log.write)(sd, e, op); } void @@ -424,7 +432,7 @@ continue; if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) continue; - sd->log.clean.write(sd, e); + (sd->log.clean.write)(sd, e); if ((++n & 0xFFFF) == 0) { getCurrentTime(); debug(20, 1) (" %7d entries written so far.\n", n); Index: squid/src/store_io.c diff -u squid/src/store_io.c:1.3.6.2 squid/src/store_io.c:1.3.14.5 --- squid/src/store_io.c:1.3.6.2 Sat Sep 10 19:13:23 2005 +++ squid/src/store_io.c Sun Sep 11 01:25:22 2005 @@ -79,14 +79,14 @@ storeRead(storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; - SD->obj.read(SD, sio, buf, size, offset, callback, callback_data); + (SD->obj.read)(SD, sio, buf, size, offset, callback, callback_data); } void storeWrite(storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; - SD->obj.write(SD, sio, buf, size, offset, free_func); + (SD->obj.write)(SD, sio, buf, size, offset, free_func); } void Index: squid/src/structs.h diff -u squid/src/structs.h:1.48.2.46 squid/src/structs.h:1.48.6.51 --- squid/src/structs.h:1.48.2.46 Fri Mar 10 19:16:31 2006 +++ squid/src/structs.h Sat Mar 11 06:07:46 2006 @@ -814,6 +814,11 @@ SSL *ssl; int ssl_shutdown:1; #endif +#ifdef _SQUID_MSWIN_ +struct { + long handle; + } win32; +#endif }; struct _fileMap { @@ -2113,6 +2118,9 @@ struct { int uses; } stats; +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; +#endif }; @@ -2142,6 +2150,9 @@ int releases; } stats; void *data; /* State data used by the calling routines */ +#ifdef _SQUID_MSWIN_ + HANDLE hIpc; +#endif }; /* Index: squid/src/tools.c diff -u squid/src/tools.c:1.19.6.21 squid/src/tools.c:1.19.14.27 --- squid/src/tools.c:1.19.6.21 Sat Jan 14 19:15:21 2006 +++ squid/src/tools.c Sun Jan 22 02:06:51 2006 @@ -291,7 +291,7 @@ #endif #endif /* PRINT_STACK_TRACE */ -#if SA_RESETHAND == 0 +#if SA_RESETHAND == 0 && !defined(_SQUID_MSWIN_) signal(SIGSEGV, SIG_DFL); signal(SIGBUS, SIG_DFL); signal(sig, SIG_DFL); @@ -314,6 +314,10 @@ void sigusr2_handle(int sig) { +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) + do_debug = 1; +#endif +#if (defined(_SQUID_MSWIN_) && !defined(_DEBUG)) || !defined(_SQUID_MSWIN_) static int state = 0; /* no debug() here; bad things happen if the signal is delivered during _db_print() */ if (state == 0) { @@ -331,6 +335,7 @@ #endif state = 0; } +#endif #if !HAVE_SIGACTION signal(sig, sigusr2_handle); /* reinstall */ #endif @@ -426,6 +431,7 @@ void sig_child(int sig) { +#ifndef _SQUID_MSWIN_ #ifdef _SQUID_NEXT_ union wait status; #else @@ -446,6 +452,7 @@ } while (pid > 0 || (pid < 0 && errno == EINTR)); signal(sig, sig_child); #endif +#endif } const char * @@ -681,6 +688,7 @@ /* try to use as many file descriptors as possible */ /* System V uses RLIMIT_NOFILE and BSD uses RLIMIT_OFILE */ struct rlimit rl; +#if !defined(_SQUID_CYGWIN_) #if defined(RLIMIT_NOFILE) if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { debug(50, 0) ("setrlimit: RLIMIT_NOFILE: %s\n", xstrerror()); @@ -708,6 +716,7 @@ } } #endif +#endif #else /* HAVE_SETRLIMIT */ debug(21, 1) ("setMaxFD: Cannot increase: setrlimit() not supported on this system\n"); #endif /* HAVE_SETRLIMIT */ @@ -774,6 +783,33 @@ if (sigaction(sig, &sa, NULL) < 0) debug(50, 0) ("sigaction: sig=%d func=%p: %s\n", sig, func, xstrerror()); #else +#ifdef _SQUID_MSWIN_ + /* + On Windows, only SIGINT, SIGILL, SIGFPE, SIGTERM, SIGBREAK, SIGABRT and SIGSEGV signals + are supported, so we must care of don't call signal() for other value. + The SIGILL, SIGSEGV, and SIGTERM signals are not generated under Windows. They are defined + for ANSI compatibility, so both SIGSEGV and SIGBUS are emulated with an Exception Handler. + */ + switch (sig) { + case SIGINT: + case SIGILL: + case SIGFPE: + case SIGTERM: + case SIGBREAK: + case SIGABRT: + break; + case SIGSEGV: + WIN32_ExceptionHandlerInit(); + break; + case SIGBUS: + WIN32_ExceptionHandlerInit(); + return; + break; /* Nor reached */ + default: + return; + break; /* Nor reached */ + } +#endif signal(sig, func); #endif } Index: squid/src/unlinkd.c diff -u squid/src/unlinkd.c:1.6.6.2 squid/src/unlinkd.c:1.6.10.11 --- squid/src/unlinkd.c:1.6.6.2 Mon Jul 21 19:13:57 2003 +++ squid/src/unlinkd.c Wed Jul 23 05:11:34 2003 @@ -74,6 +74,11 @@ static int unlinkd_wfd = -1; static int unlinkd_rfd = -1; +#ifdef _SQUID_MSWIN_ +static HANDLE hIpc; +static pid_t pid; +#endif + #define UNLINKD_QUEUE_LIMIT 20 void @@ -113,7 +118,11 @@ int x; int i; char rbuf[512]; +#ifdef _SQUID_MSWIN_ + x = recv(unlinkd_rfd, rbuf, 511, 0); +#else x = read(unlinkd_rfd, rbuf, 511); +#endif if (x > 0) { rbuf[x] = '\0'; for (i = 0; i < x; i++) @@ -126,7 +135,11 @@ assert(l < MAXPATHLEN); xstrncpy(buf, path, MAXPATHLEN); buf[l++] = '\n'; +#ifdef _SQUID_MSWIN_ + x = send(unlinkd_wfd, buf, l, 0); +#else x = write(unlinkd_wfd, buf, l); +#endif if (x < 0) { debug(2, 1) ("unlinkdUnlink: write FD %d failed: %s\n", unlinkd_wfd, xstrerror()); @@ -146,6 +159,28 @@ void unlinkdClose(void) { +#ifdef _SQUID_MSWIN_ + if (unlinkd_wfd > -1) { + debug(2, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd); + shutdown(unlinkd_wfd, SD_BOTH); + comm_close(unlinkd_wfd); + if (unlinkd_wfd != unlinkd_rfd) + comm_close(unlinkd_rfd); + unlinkd_wfd = -1; + unlinkd_rfd = -1; + } else + debug(2, 0) ("unlinkdClose: WARNING: unlinkd_wfd is %d\n", + unlinkd_wfd); + if (hIpc) { + if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) { + getCurrentTime(); + debug(2, 1) + ("unlinkdClose: WARNING: (unlinkd,%ld) didn't exit in 5 seconds\n", + pid); + } + CloseHandle(hIpc); + } +#else if (unlinkd_wfd < 0) return; debug(2, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd); @@ -154,6 +189,7 @@ file_close(unlinkd_rfd); unlinkd_wfd = -1; unlinkd_rfd = -1; +#endif } void @@ -167,6 +203,9 @@ #if HAVE_POLL && defined(_SQUID_OSF_) /* pipes and poll() don't get along on DUNIX -DW */ x = ipcCreate(IPC_TCP_SOCKET, +#elif defined(_SQUID_MSWIN_) + /* select() will fail on a pipe */ + x = ipcCreate(IPC_TCP_SOCKET, #else x = ipcCreate(IPC_FIFO, #endif @@ -174,7 +213,11 @@ args, "unlinkd", &unlinkd_rfd, - &unlinkd_wfd); + &unlinkd_wfd +#ifdef _SQUID_MSWIN_ + , &hIpc, &pid +#endif + ); if (x < 0) fatal("Failed to create unlinkd subprocess"); slp.tv_sec = 0; Index: squid/src/wccp.c diff -u squid/src/wccp.c:1.5.56.10 squid/src/wccp.c:1.5.64.11 --- squid/src/wccp.c:1.5.56.10 Sun Feb 20 11:42:04 2005 +++ squid/src/wccp.c Tue Feb 22 04:59:27 2005 @@ -130,7 +130,7 @@ return; } theInWccpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Wccp.incoming, port, COMM_NONBLOCKING, @@ -146,7 +146,7 @@ (int) port, theInWccpConnection); if (Config.Wccp.outgoing.s_addr != no_addr.s_addr) { theOutWccpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Wccp.outgoing, port, COMM_NONBLOCKING, Index: squid/src/win32.c diff -u squid/src/win32.c:1.5.6.2 squid/src/win32.c:1.5.14.24 --- squid/src/win32.c:1.5.6.2 Tue Sep 20 17:59:13 2005 +++ squid/src/win32.c Tue Sep 20 03:07:27 2005 @@ -6,34 +6,225 @@ * * (C) 2001 Guido Serassio , * inspired by previous work by Romeo Anghelache & Eric Stern. - * 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. + * + * 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. + * 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. * */ +#ifndef WIN32_C +#define WIN32_C + #include "squid.h" /* This code compiles only CygWin & Windows NT Port */ #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) #include +#ifdef _SQUID_MSWIN_ +#if HAVE_WIN32_PSAPI +#include +#endif +#ifndef _MSWSOCK_ +#include +#endif +#include +#endif static unsigned int GetOSVersion(); +void WIN32_svcstatusupdate(DWORD, DWORD); +void WINAPI WIN32_svcHandler(DWORD); +static int WIN32_StoreKey(const char *, DWORD, unsigned char *, int); +static int WIN32_create_key(void); +static void WIN32_build_argv (char *); +void WINAPI SquidMain(DWORD, char **); + +/* The following code section is part of an EXPERIMENTAL native */ +/* Windows NT/2000 Squid port - Compiles only on MS Visual C++ */ +#if defined(_SQUID_MSWIN_) +static int Win32SockInit(void); +static void Win32SockCleanup(void); +extern LPCRITICAL_SECTION dbg_mutex; +void WIN32_ExceptionHandlerCleanup(void); +static LPTOP_LEVEL_EXCEPTION_FILTER Win32_Old_ExceptionHandler = NULL; +#endif /* End native Windows NT EXPERIMENTAL PORT */ + +static SERVICE_STATUS svcStatus; +static SERVICE_STATUS_HANDLE svcHandle; +static int WIN32_argc; +static char ** WIN32_argv; +static char * WIN32_module_name; +static int Squid_Aborting = 0; + +#define VENDOR "GNU" +#if defined(_SQUID_MSWIN_) +#define SOFTWARENAME "SquidNT" +#else +#define SOFTWARENAME "Squid" +#endif +#define WIN32_VERSION "2.5" +#define COMMANDLINE "CommandLine" +#define CONFIGFILE "ConfigFile" +#undef ChangeServiceConfig2 +typedef BOOL (WINAPI * PFChangeServiceConfig2) (SC_HANDLE, DWORD, LPVOID); +#ifdef UNICODE +#define CHANGESERVICECONFIG2 "ChangeServiceConfig2W" +#else +#define CHANGESERVICECONFIG2 "ChangeServiceConfig2A" +#endif +static SC_ACTION Squid_SCAction[] = { { SC_ACTION_RESTART, 60000 } }; +static SERVICE_DESCRIPTION Squid_ServiceDescription = { SOFTWARENAME " " VERSION " WWW Proxy Server" }; +static SERVICE_FAILURE_ACTIONS Squid_ServiceFailureActions = { INFINITE, NULL, NULL, 1, Squid_SCAction }; +static char REGKEY[256]="SOFTWARE\\"VENDOR"\\"SOFTWARENAME"\\"WIN32_VERSION"\\"; +static char *keys[] = { + "SOFTWARE", /* key[0] */ + VENDOR, /* key[1] */ + SOFTWARENAME, /* key[2] */ + WIN32_VERSION, /* key[3] */ + NULL, /* key[4] */ + NULL /* key[5] */ +}; /* ====================================================================== */ /* LOCAL FUNCTIONS */ /* ====================================================================== */ +static int +WIN32_create_key(void) +{ + int index; + HKEY hKey; + HKEY hKeyNext; + int retval; + LONG rv; + + hKey = HKEY_LOCAL_MACHINE; + index = 0; + retval = 0; + + /* Walk the tree, creating at each stage if necessary */ + while (keys[index]) { + unsigned long result; + rv = RegCreateKeyEx(hKey, keys[index], /* subkey */ + 0, /* reserved */ + NULL, /* class */ + REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKeyNext, &result); + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegCreateKeyEx(%s),%d\n", keys[index], (int) rv); + retval = -4; + } + /* Close the old key */ + rv = RegCloseKey(hKey); + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegCloseKey %d\n", (int) rv); + if (retval == 0) { + /* Keep error status from RegCreateKeyEx, if any */ + retval = -4; + } + } + if (retval) { + break; + } + hKey = hKeyNext; + index++; + } + if (keys[index] == NULL) { + /* Close the final key we opened, if we walked the entire + * tree + */ + rv = RegCloseKey(hKey); + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegCloseKey %d\n", (int) rv); + if (retval == 0) { + /* Keep error status from RegCreateKeyEx, if any */ + retval = -4; + } + } + } + return retval; +} + +static int +WIN32_StoreKey(const char *key, DWORD type, unsigned char *value, + int value_size) +{ + LONG rv; + HKEY hKey; + int retval; + + rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGKEY, 0, KEY_WRITE, &hKey); + if (rv == ERROR_FILE_NOT_FOUND) { + /* Key could not be opened -- try to create it + */ + if (WIN32_create_key() < 0) { + /* Creation failed (error already reported) */ + return -4; + } + /* Now it has been created we should be able to open it + */ + rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGKEY, 0, KEY_WRITE, &hKey); + if (rv == ERROR_FILE_NOT_FOUND) { + fprintf(stderr, "Registry does not contain key %s after creation\n", + REGKEY); + return -1; + } + } + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegOpenKeyEx HKLM\\%s, %d\n", REGKEY, (int) rv); + return -4; + } + /* Now set the value and data */ + rv = RegSetValueEx(hKey, key, /* value key name */ + 0, /* reserved */ + type, /* type */ + value, /* value data */ + (DWORD) value_size); /* for size of "value" */ + retval = 0; /* Return value */ + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegQueryValueEx(key %s),%d\n", key, (int) rv); + retval = -4; + } else { + fprintf(stderr, "Registry stored HKLM\\%s\\%s value %s\n", + REGKEY, + key, + type == REG_SZ ? value : (unsigned char *) "(not displayable)"); + } + /* Make sure we close the key even if there was an error storing + * the data + */ + rv = RegCloseKey(hKey); + if (rv != ERROR_SUCCESS) { + fprintf(stderr, "RegCloseKey HKLM\\%s, %d\n", REGKEY, (int) rv); + if (retval == 0) { + /* Keep error status from RegQueryValueEx, if any */ + retval = -4; + } + } + return retval; +} + static unsigned int GetOSVersion() { @@ -91,24 +282,671 @@ return _WIN_OS_UNKNOWN; } +/* Build argv, argc from string passed from Windows. */ +static void WIN32_build_argv(char *cmd) +{ + int argvlen = 0; + char *word; + + WIN32_argc = 1; + WIN32_argv = (char **) xmalloc ((WIN32_argc+1) * sizeof (char *)); + WIN32_argv[0]=xstrdup(WIN32_module_name); +/* Scan command line until there is nothing left. */ + while (*cmd) { + /* Ignore spaces */ + if (xisspace(*cmd)) { + cmd++; + continue; + } + /* Found the beginning of an argument. */ + word = cmd; + while (*cmd) { + cmd++; /* Skip over this character */ + if (xisspace(*cmd)) /* End of argument if space */ + break; + } + if (*cmd) + *cmd++ = '\0'; /* Terminate `word' */ + /* See if we need to allocate more space for argv */ + if (WIN32_argc >= argvlen) { + argvlen = WIN32_argc + 1; + WIN32_argv = (char **) xrealloc (WIN32_argv, (1 + argvlen) * sizeof (char *)); + } + /* Add word to argv file. */ + WIN32_argv[WIN32_argc++] = word; + } + WIN32_argv[WIN32_argc] = NULL; +} + /* ====================================================================== */ /* PUBLIC FUNCTIONS */ /* ====================================================================== */ void +WIN32_Abort(int sig) +{ +#if USE_WIN32_SERVICE + svcStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; + svcStatus.dwServiceSpecificExitCode = 1; +#endif + Squid_Aborting = 1; + WIN32_Exit(); +} + +void WIN32_Exit() { +#ifdef _SQUID_MSWIN_ + Win32SockCleanup(); +#endif +#if USE_WIN32_SERVICE + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + if (!Squid_Aborting) { + svcStatus.dwCurrentState = SERVICE_STOPPED; + SetServiceStatus(svcHandle, &svcStatus); + } + } +#endif +#ifdef _SQUID_MSWIN_ + if (dbg_mutex) + DeleteCriticalSection(dbg_mutex); + WIN32_ExceptionHandlerCleanup(); +#endif _exit(0); } -int -WIN32_Subsystem_Init() +#if USE_WIN32_SERVICE +int WIN32_Subsystem_Init(int * argc, char *** argv) +#else +int WIN32_Subsystem_Init() +#endif { WIN32_OS_version = GetOSVersion(); if ((WIN32_OS_version == _WIN_OS_UNKNOWN) || (WIN32_OS_version == _WIN_OS_WIN32S)) return 1; if (atexit(WIN32_Exit) != 0) return 1; +#if USE_WIN32_SERVICE + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + char path[512]; + HKEY hndKey; + if (signal(SIGABRT, WIN32_Abort) == SIG_ERR) + return 1; + /* Register the service Handler function */ + svcHandle = + RegisterServiceCtrlHandler(WIN32_Service_name, + WIN32_svcHandler); + if (svcHandle == 0) + return 1; + /* Set Process work dir to directory cointaining squid.exe */ + GetModuleFileName(NULL, path, 512); + WIN32_module_name=xstrdup(path); + path[strlen(path) - 10] = '\0'; + if (SetCurrentDirectory(path) == 0) + return 1; + safe_free(ConfigFile); + /* get config file from Windows Registry */ + if (RegOpenKey(HKEY_LOCAL_MACHINE, REGKEY, &hndKey) == ERROR_SUCCESS) { + DWORD Type = 0; + DWORD Size = 0; + LONG Result; + Result = + RegQueryValueEx(hndKey, CONFIGFILE, NULL, &Type, NULL, &Size); + if (Result == ERROR_SUCCESS && Size) { + ConfigFile = xmalloc(Size); + RegQueryValueEx(hndKey, CONFIGFILE, NULL, &Type, ConfigFile, + &Size); + } else + ConfigFile = xstrdup(DefaultConfigFile); + Size = 0; + Type = 0; + Result = + RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, NULL, &Size); + if (Result == ERROR_SUCCESS && Size) { + WIN32_Service_Command_Line = xmalloc(Size); + RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, WIN32_Service_Command_Line, + &Size); + } else + WIN32_Service_Command_Line = xstrdup(""); + RegCloseKey(hndKey); + } else { + ConfigFile = xstrdup(DefaultConfigFile); + WIN32_Service_Command_Line = xstrdup(""); + } + WIN32_build_argv(WIN32_Service_Command_Line); + *argc = WIN32_argc; + *argv = WIN32_argv; + /* Set Service Status to SERVICE_START_PENDING */ + svcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + svcStatus.dwCurrentState = SERVICE_START_PENDING; + svcStatus.dwControlsAccepted = + SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + svcStatus.dwWin32ExitCode = 0; + svcStatus.dwServiceSpecificExitCode = 0; + svcStatus.dwCheckPoint = 0; + svcStatus.dwWaitHint = 10000; + SetServiceStatus(svcHandle, &svcStatus); +#ifdef _SQUID_MSWIN_ + _setmaxstdio(Squid_MaxFD); +#endif + } +#endif +#ifdef _SQUID_MSWIN_ + if (Win32SockInit() < 0) + return 1; +#endif + return 0; +} + +#if USE_WIN32_SERVICE +void +WIN32_svcstatusupdate(DWORD svcstate, DWORD WaitHint) +{ + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { + svcStatus.dwCheckPoint++; + svcStatus.dwWaitHint = WaitHint; + svcStatus.dwCurrentState = svcstate; + SetServiceStatus(svcHandle, &svcStatus); + } +} + +VOID WINAPI +WIN32_svcHandler(DWORD Opcode) +{ + DWORD status; + + switch (Opcode) { + case _WIN_SQUID_SERVICE_CONTROL_STOP: + case _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN: +/* Do whatever it takes to stop here. */ + svcStatus.dwWin32ExitCode = 0; + svcStatus.dwCurrentState = SERVICE_STOP_PENDING; + svcStatus.dwCheckPoint = 0; + svcStatus.dwWaitHint = 10000; + shut_down(SIGTERM); + if (!SetServiceStatus(svcHandle, &svcStatus)) { + status = GetLastError(); + debug(1, 1) ("SetServiceStatus error %ld\n", status); + } + debug(1, 1) ("Leaving Squid service\n"); + return; + case _WIN_SQUID_SERVICE_CONTROL_INTERROGATE: +/* Fall through to send current status. */ + if (!SetServiceStatus(svcHandle, &svcStatus)) { + status = GetLastError(); + debug(1, 1) ("SetServiceStatus error %ld\n", status); + } + break; + case _WIN_SQUID_SERVICE_CONTROL_ROTATE: + rotate_logs(SIGUSR1); + break; + case _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE: + reconfigure(SIGHUP); + break; + case _WIN_SQUID_SERVICE_CONTROL_DEBUG: + sigusr2_handle(SIGUSR2); + break; + case _WIN_SQUID_SERVICE_CONTROL_INTERRUPT: +/* Do whatever it takes to stop here. */ + svcStatus.dwWin32ExitCode = 0; + svcStatus.dwCurrentState = SERVICE_STOP_PENDING; + svcStatus.dwCheckPoint = 0; + svcStatus.dwWaitHint = 10000; + shut_down(SIGINT); + if (!SetServiceStatus(svcHandle, &svcStatus)) { + status = GetLastError(); + debug(1, 1) ("SetServiceStatus error %ld\n", status); + } + debug(1, 1) ("Leaving Squid service\n"); + break; + default: + debug(1, 1) ("Unrecognized opcode %ld\n", Opcode); + } + return; +} + +void +WIN32_RemoveService() +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + + if (!WIN32_Service_name) + WIN32_Service_name = xstrdup(_WIN_SQUID_DEFAULT_SERVICE_NAME); + strcat(REGKEY, WIN32_Service_name); + keys[4] = WIN32_Service_name; + schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ + NULL, /* database (NULL == default) */ + SC_MANAGER_ALL_ACCESS /* access required */ + ); + if (!schSCManager) + fprintf(stderr, "OpenSCManager failed\n"); + else { + schService = OpenService(schSCManager, WIN32_Service_name, SERVICE_ALL_ACCESS); + if (schService == NULL) + fprintf(stderr, "OpenService failed\n"); + /* Could not open the service */ + else { + /* try to stop the service */ + if (ControlService(schService, _WIN_SQUID_SERVICE_CONTROL_STOP, + &svcStatus)) { + sleep(1); + while (QueryServiceStatus(schService, &svcStatus)) { + if (svcStatus.dwCurrentState == SERVICE_STOP_PENDING) + sleep(1); + else + break; + } + } + /* now remove the service */ + if (DeleteService(schService) == 0) + fprintf(stderr, "DeleteService failed.\n"); + else + printf("Service %s deleted successfully.\n", + WIN32_Service_name); + CloseServiceHandle(schService); + } + CloseServiceHandle(schSCManager); + } +} + +void +WIN32_SetServiceCommandLine() +{ + if (!WIN32_Service_name) + WIN32_Service_name = xstrdup(_WIN_SQUID_DEFAULT_SERVICE_NAME); + strcat(REGKEY, WIN32_Service_name); + keys[4] = WIN32_Service_name; + /* Now store the Service Command Line in the registry */ + WIN32_StoreKey(COMMANDLINE, REG_SZ, (unsigned char *) WIN32_Command_Line, strlen(WIN32_Command_Line) + 1); +} + +void +WIN32_InstallService() +{ + SC_HANDLE schService; + SC_HANDLE schSCManager; + char ServicePath[512]; + char szPath[512]; + int lenpath; + + if (!WIN32_Service_name) + WIN32_Service_name = xstrdup(_WIN_SQUID_DEFAULT_SERVICE_NAME); + strcat(REGKEY, WIN32_Service_name); + keys[4] = WIN32_Service_name; + if ((lenpath = GetModuleFileName(NULL, ServicePath, 512)) == 0) { + fprintf(stderr, "Can't get executable path\n"); + exit(1); + } + snprintf(szPath, sizeof(szPath), "%s %s:%s", ServicePath, _WIN_SQUID_SERVICE_OPTION, WIN32_Service_name); + schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ + NULL, /* database (NULL == default) */ + SC_MANAGER_ALL_ACCESS /* access required */ + ); + if (!schSCManager) { + fprintf(stderr, "OpenSCManager failed\n"); + exit(1); + } + else { + schService = CreateService(schSCManager, /* SCManager database */ + WIN32_Service_name, /* name of service */ + WIN32_Service_name, /* name to display */ + SERVICE_ALL_ACCESS, /* desired access */ + SERVICE_WIN32_OWN_PROCESS, /* service type */ + SERVICE_AUTO_START, /* start type */ + SERVICE_ERROR_NORMAL, /* error control type */ + (const char *) szPath, /* service's binary */ + NULL, /* no load ordering group */ + NULL, /* no tag identifier */ + "Tcpip\0AFD\0", /* dependencies */ + NULL, /* LocalSystem account */ + NULL); /* no password */ + if (schService) { + if (WIN32_OS_version > _WIN_OS_WINNT) + { + HMODULE ADVAPI32Handle; + PFChangeServiceConfig2 ChangeServiceConfig2; + DWORD dwInfoLevel = SERVICE_CONFIG_DESCRIPTION; + + ADVAPI32Handle = GetModuleHandle("advapi32"); + ChangeServiceConfig2 = (PFChangeServiceConfig2) GetProcAddress(ADVAPI32Handle, CHANGESERVICECONFIG2); + ChangeServiceConfig2(schService, dwInfoLevel, &Squid_ServiceDescription); + dwInfoLevel = SERVICE_CONFIG_FAILURE_ACTIONS; + ChangeServiceConfig2(schService, dwInfoLevel, &Squid_ServiceFailureActions); + } + CloseServiceHandle(schService); + /* Now store the config file location in the registry */ + if (!ConfigFile) + ConfigFile = xstrdup(DefaultConfigFile); + WIN32_StoreKey(CONFIGFILE, REG_SZ, (unsigned char *) ConfigFile, strlen(ConfigFile) + 1); + printf("Squid Cache version %s for %s\n", version_string, + CONFIG_HOST_TYPE); + printf("installed successfully as %s Windows System Service.\n", + WIN32_Service_name); + printf + ("To run, start it from the Services Applet of Control Panel.\n"); + printf("Don't forget to edit squid.conf before starting it.\n\n"); + } else { + fprintf(stderr, "CreateService failed\n"); + exit(1); + } + CloseServiceHandle(schSCManager); + } +} + +void +WIN32_sendSignal(int WIN32_signal) +{ + SERVICE_STATUS ssStatus; + DWORD fdwAccess, fdwControl; + SC_HANDLE schService; + SC_HANDLE schSCManager; + + if (!WIN32_Service_name) + WIN32_Service_name = xstrdup(_WIN_SQUID_DEFAULT_SERVICE_NAME); + schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ + NULL, /* database (NULL == default) */ + SC_MANAGER_ALL_ACCESS /* access required */ + ); + if (!schSCManager) { + fprintf(stderr, "OpenSCManager failed\n"); + exit(1); + } + /* The required service object access depends on the control. */ + switch (WIN32_signal) { + case 0: /* SIGNULL */ + fdwAccess = SERVICE_INTERROGATE; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_INTERROGATE; + break; + case SIGUSR1: + fdwAccess = SERVICE_USER_DEFINED_CONTROL; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_ROTATE; + break; + case SIGUSR2: + fdwAccess = SERVICE_USER_DEFINED_CONTROL; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_DEBUG; + break; + case SIGHUP: + fdwAccess = SERVICE_USER_DEFINED_CONTROL; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE; + break; + case SIGTERM: + fdwAccess = SERVICE_STOP; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_STOP; + break; + case SIGINT: + case SIGKILL: + fdwAccess = SERVICE_USER_DEFINED_CONTROL; + fdwControl = _WIN_SQUID_SERVICE_CONTROL_INTERRUPT; + break; + default: + exit(1); + } + /* Open a handle to the service. */ + schService = OpenService(schSCManager, /* SCManager database */ + WIN32_Service_name, /* name of service */ + fdwAccess); /* specify access */ + if (schService == NULL) { + fprintf(stderr, "%s: ERROR: Could not open Service %s\n", appname, + WIN32_Service_name); + exit(1); + } else { + /* Send a control value to the service. */ + if (!ControlService(schService, /* handle of service */ + fdwControl, /* control value to send */ + &ssStatus)) { /* address of status info */ + fprintf(stderr, "%s: ERROR: Could not Control Service %s\n", + appname, WIN32_Service_name); + exit(1); + } else { + /* Print the service status. */ + printf("\nStatus of %s Service:\n", WIN32_Service_name); + printf(" Service Type: 0x%lx\n", ssStatus.dwServiceType); + printf(" Current State: 0x%lx\n", ssStatus.dwCurrentState); + printf(" Controls Accepted: 0x%lx\n", ssStatus.dwControlsAccepted); + printf(" Exit Code: %ld\n", ssStatus.dwWin32ExitCode); + printf(" Service Specific Exit Code: %ld\n", + ssStatus.dwServiceSpecificExitCode); + printf(" Check Point: %ld\n", ssStatus.dwCheckPoint); + printf(" Wait Hint: %ld\n", ssStatus.dwWaitHint); + } + CloseServiceHandle(schService); + } + CloseServiceHandle(schSCManager); +} + +int main(int argc, char **argv) +{ + SERVICE_TABLE_ENTRY DispatchTable[] = { + {NULL, SquidMain}, + {NULL, NULL} + }; + char *c; + char stderr_path[256]; + + if ((argc == 2) && strstr(argv[1], _WIN_SQUID_SERVICE_OPTION)){ + strcpy(stderr_path, argv[0]); + strcat(stderr_path,".log"); + freopen(stderr_path, "w", stderr); + setmode(fileno(stderr), O_TEXT); + WIN32_run_mode = _WIN_SQUID_RUN_MODE_SERVICE; + if (!(c=strchr(argv[1],':'))){ + fprintf(stderr, "Bad Service Parameter: %s\n", argv[1]); + return 1; + } + WIN32_Service_name = xstrdup(c+1); + DispatchTable[0].lpServiceName=WIN32_Service_name; + strcat(REGKEY, WIN32_Service_name); + keys[4] = WIN32_Service_name; + if (!StartServiceCtrlDispatcher(DispatchTable)) { + fprintf(stderr, "StartServiceCtrlDispatcher error = %ld\n", + GetLastError()); + return 1; + } + } else { + WIN32_run_mode = _WIN_SQUID_RUN_MODE_INTERACTIVE; + SquidMain(argc, argv); + } + return 0; +} +#endif + +/* The following code section is part of an EXPERIMENTAL native */ +/* Windows NT/2000 Squid port - Compiles only on MS Visual C++ or MinGW */ + +#if defined(_SQUID_MSWIN_) +static int s_iInitCount = 0; + +int WIN32_pipe(int handles[2]) +{ + int new_socket; + fde *F = NULL; + + struct sockaddr_in serv_addr; + int len = sizeof(serv_addr); + u_short handle1_port; + + handles[0] = handles[1] = -1; + + statCounter.syscalls.sock.sockets++; + if ((new_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) + return -1; + + memset((void *) &serv_addr, 0, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(0); + serv_addr.sin_addr = local_addr; + + if (bind(new_socket, (SOCKADDR *) & serv_addr, len) < 0 || + listen(new_socket, 1) < 0 || getsockname(new_socket, (SOCKADDR *) & serv_addr, &len) < 0 || + (handles[1] = socket(PF_INET, SOCK_STREAM, 0)) < 0) + { + closesocket(new_socket); + return -1; + } + + handle1_port = ntohs(serv_addr.sin_port); + if (connect(handles[1], (SOCKADDR *) & serv_addr, len) < 0 || + (handles[0] = accept(new_socket, (SOCKADDR *) & serv_addr, &len)) < 0) + { + closesocket(handles[1]); + handles[1] = -1; + closesocket(new_socket); + return -1; + } + closesocket(new_socket); + + F = &fd_table[handles[0]]; + F->local_addr = local_addr; + F->local_port = ntohs(serv_addr.sin_port); + + F = &fd_table[handles[1]]; + F->local_addr = local_addr; + xstrncpy(F->ipaddr, inet_ntoa(local_addr), 16); + F->remote_port = handle1_port; + + return 0; +} + +int WIN32_getrusage(int who, struct rusage *usage) +{ +#if HAVE_WIN32_PSAPI + if ((WIN32_OS_version == _WIN_OS_WINNT) || (WIN32_OS_version == _WIN_OS_WIN2K) + || (WIN32_OS_version == _WIN_OS_WINXP) || (WIN32_OS_version == _WIN_OS_WINNET)) + { + /* On Windows NT/2000 call PSAPI.DLL for process Memory */ + /* informations -- Guido Serassio */ + HANDLE hProcess; + PROCESS_MEMORY_COUNTERS pmc; + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | + PROCESS_VM_READ, + FALSE, GetCurrentProcessId()); + { + /* Microsoft CRT doesn't have getrusage function, */ + /* so we get process CPU time information from PSAPI.DLL. */ + FILETIME ftCreate, ftExit, ftKernel, ftUser; + if (GetProcessTimes(hProcess, &ftCreate, &ftExit, &ftKernel, &ftUser)) + { + int64_t tUser64 = (*(int64_t *)&ftUser / 10); + int64_t tKernel64 = (*(int64_t *)&ftKernel / 10); + usage->ru_utime.tv_sec =(long)(tUser64 / 1000000); + usage->ru_stime.tv_sec =(long)(tKernel64 / 1000000); + usage->ru_utime.tv_usec =(long)(tUser64 % 1000000); + usage->ru_stime.tv_usec =(long)(tKernel64 % 1000000); + } + else + { + CloseHandle( hProcess ); + return -1; + } + } + if (GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc))) + { + usage->ru_maxrss=(DWORD)(pmc.WorkingSetSize / getpagesize()); + usage->ru_majflt=pmc.PageFaultCount; + } + else + { + CloseHandle( hProcess ); + return -1; + } + CloseHandle( hProcess ); + } +#endif return 0; } + +static int Win32SockInit(void) +{ + int iVersionRequested; + WSADATA wsaData; + int err, opt; + int optlen = sizeof(opt); + + + if (s_iInitCount > 0) { + s_iInitCount++; + return (0); + } + else if (s_iInitCount < 0) + return (s_iInitCount); + /* s_iInitCount == 0. Do the initailization */ + iVersionRequested = MAKEWORD(2, 0); + err = WSAStartup((WORD) iVersionRequested, &wsaData); + if (err) { + s_iInitCount = -1; + return (s_iInitCount); + } + if (LOBYTE(wsaData.wVersion) != 2 || + HIBYTE(wsaData.wVersion) != 0) { + s_iInitCount = -2; + WSACleanup(); + return (s_iInitCount); + } + if (WIN32_OS_version !=_WIN_OS_WINNT) { + if (getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&opt, &optlen)) { + s_iInitCount = -3; + WSACleanup(); + return (s_iInitCount); + } else { + opt = opt | SO_SYNCHRONOUS_NONALERT; + if (setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, optlen)) { + s_iInitCount = -3; + WSACleanup(); + return (s_iInitCount); + } + } + } + WIN32_Socks_initialized = 1; + s_iInitCount++; + return (s_iInitCount); +} + +static void Win32SockCleanup(void) +{ + if (--s_iInitCount == 0) + WSACleanup(); + return; +} + +LONG CALLBACK WIN32_ExceptionHandler(EXCEPTION_POINTERS* ep) +{ + EXCEPTION_RECORD* er; + + er = ep->ExceptionRecord; + + switch (er->ExceptionCode) { + case EXCEPTION_ACCESS_VIOLATION: + raise(SIGSEGV); + break; + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_IN_PAGE_ERROR: + death(SIGBUS); + break; + default: + break; + } + + return EXCEPTION_CONTINUE_SEARCH; +} + + +void WIN32_ExceptionHandlerInit() +{ +#if !defined(_DEBUG) + if (Win32_Old_ExceptionHandler == NULL) + Win32_Old_ExceptionHandler = SetUnhandledExceptionFilter(WIN32_ExceptionHandler); #endif +} + +void WIN32_ExceptionHandlerCleanup() +{ + if (Win32_Old_ExceptionHandler != NULL) + SetUnhandledExceptionFilter(Win32_Old_ExceptionHandler); +} + +#endif /* End native Windows NT EXPERIMENTAL PORT */ +#endif + +#endif /* WIN32_C */ Index: squid/src/auth/Makefile.am diff -u squid/src/auth/Makefile.am:1.2 squid/src/auth/Makefile.am:1.2.40.1 --- squid/src/auth/Makefile.am:1.2 Sat Sep 1 04:46:49 2001 +++ squid/src/auth/Makefile.am Sun Oct 27 02:46:15 2002 @@ -14,5 +14,9 @@ libdigest_a_SOURCES = digest/auth_digest.c digest/auth_digest.h libntlm_a_SOURCES = ntlm/auth_ntlm.c ntlm/auth_ntlm.h -INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/ +if ENABLE_WIN32SPECIFIC +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src +else +INCLUDES = -I. -I$(top_srcdir)/include -I$(top_srcdir)/src +endif Index: squid/src/auth/ntlm/auth_ntlm.c diff -u squid/src/auth/ntlm/auth_ntlm.c:1.18.2.20 squid/src/auth/ntlm/auth_ntlm.c:1.18.2.1.4.25 --- squid/src/auth/ntlm/auth_ntlm.c:1.18.2.20 Sat Feb 25 19:13:58 2006 +++ squid/src/auth/ntlm/auth_ntlm.c Sun Feb 26 01:14:43 2006 @@ -241,6 +241,15 @@ debug(28, 1) ("challenge reuses incompatible with use_ntlm_negotiate. Disabling challenge reuse\n"); ntlmConfig->challengeuses = 0; } + /* Native Windows helpers don't allow Challenge reuse even when + * running without NTLM NEGOTIATE packet support. + */ +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) + if (ntlmConfig->challengeuses > 0) { + debug(28, 1) ("challenge reuses incompatible with Windows platform. Disabling challenge reuse\n"); + ntlmConfig->challengeuses = 0; + } +#endif if (!ntlm_helper_state_pool) ntlm_helper_state_pool = memPoolCreate("NTLM Helper State data", sizeof(ntlm_helper_state_t)); if (!ntlm_user_pool) Index: squid/src/fs/Makefile.am diff -u squid/src/fs/Makefile.am:1.2.32.1 squid/src/fs/Makefile.am:1.2.40.4 --- squid/src/fs/Makefile.am:1.2.32.1 Tue May 21 00:00:19 2002 +++ squid/src/fs/Makefile.am Sun Aug 21 07:05:29 2005 @@ -5,14 +5,16 @@ AUTOMAKE_OPTIONS = subdir-objects -DIST_SUBDIRS = aufs coss diskd null ufs +DIST_SUBDIRS = aufs awin32 coss diskd null ufs SUBDIRS = @STORE_MODULE_SUBDIRS@ -EXTRA_LIBRARIES = libaufs.a libcoss.a libdiskd.a libnull.a libufs.a +EXTRA_LIBRARIES = libaufs.a libawin32.a libcoss.a libdiskd.a libnull.a libufs.a noinst_LIBRARIES = @STORE_LIBS@ libaufs_a_SOURCES = aufs/aiops.c aufs/async_io.c aufs/store_asyncufs.h \ aufs/store_dir_aufs.c aufs/store_io_aufs.c +libawin32_a_SOURCES = awin32/aiops.c awin32/async_io.c awin32/store_asyncufs.h \ + awin32/store_dir_aufs.c awin32/store_io_aufs.c libcoss_a_SOURCES = coss/store_coss.h coss/store_io_coss.c coss/store_dir_coss.c \ coss/async_io.c coss/async_io.h libdiskd_a_SOURCES = diskd/diskd.c diskd/store_dir_diskd.c diskd/store_diskd.h \ @@ -23,12 +25,18 @@ EXTRA_DIST = \ coss/coss-notes.txt -INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/ +if ENABLE_WIN32SPECIFIC +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src +else +INCLUDES = -I. -I$(top_srcdir)/include -I$(top_srcdir)/src +endif ## targets below to emulate distributed makefiles aufs/all: libaufs.a aufs/clean: clean +awin32/all: libawin32.a +awin32/clean: clean coss/all: libcoss.a coss/clean: clean null/all: libnull.a Index: squid/src/fs/awin32/.cvsignore diff -u /dev/null squid/src/fs/awin32/.cvsignore:1.1.36.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/.cvsignore Sun Nov 10 08:02:12 2002 @@ -0,0 +1,2 @@ +.cvsignore +Makefile.in Index: squid/src/fs/awin32/Makefile.am diff -u /dev/null squid/src/fs/awin32/Makefile.am:1.1.18.1 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/Makefile.am Thu Mar 14 12:23:47 2002 @@ -0,0 +1,2 @@ +all clean: + @cd .. && $(MAKE) $(MFLAGS) awin32/$@ Index: squid/src/fs/awin32/aiops.c diff -u /dev/null squid/src/fs/awin32/aiops.c:1.1.62.19 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/aiops.c Mon Dec 26 11:31:04 2005 @@ -0,0 +1,1065 @@ +/* + * $Id$ + * + * DEBUG: section 43 AIOPS + * AUTHOR: Stewart Forster + * + * 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 +#include "store_asyncufs.h" + +#include +#include +#include +#include +#include +#include +#include + +#define RIDICULOUS_LENGTH 4096 + +#ifdef AUFS_IO_THREADS +int squidaio_nthreads = AUFS_IO_THREADS; +#else +int squidaio_nthreads = 0; +#endif +int squidaio_magic1 = 1; /* dummy initializer value */ +int squidaio_magic2 = 1; /* real value set in aiops.c */ + +enum _squidaio_thread_status { + _THREAD_STARTING = 0, + _THREAD_WAITING, + _THREAD_BUSY, + _THREAD_FAILED, + _THREAD_DONE +}; +typedef enum _squidaio_thread_status squidaio_thread_status; + +enum _squidaio_request_type { + _AIO_OP_NONE = 0, + _AIO_OP_OPEN, + _AIO_OP_READ, + _AIO_OP_WRITE, + _AIO_OP_CLOSE, + _AIO_OP_UNLINK, + _AIO_OP_TRUNCATE, + _AIO_OP_OPENDIR, + _AIO_OP_STAT +}; +typedef enum _squidaio_request_type squidaio_request_type; + +typedef struct squidaio_request_t { + struct squidaio_request_t *next; + squidaio_request_type request_type; + int cancelled; + char *path; + int oflag; + mode_t mode; + int fd; + char *bufferp; + int buflen; + off_t offset; + int whence; + int ret; + int err; + struct stat *tmpstatp; + struct stat *statp; + squidaio_result_t *resultp; +} squidaio_request_t; + +typedef struct squidaio_request_queue_t { + HANDLE mutex; + HANDLE cond; /* See Event objects */ + squidaio_request_t *volatile head; + squidaio_request_t *volatile *volatile tailp; + unsigned long requests; + unsigned long blocked; /* main failed to lock the queue */ +} squidaio_request_queue_t; + +typedef struct squidaio_thread_t squidaio_thread_t; +struct squidaio_thread_t { + squidaio_thread_t *next; + HANDLE thread; + DWORD dwThreadId; /* thread ID */ + squidaio_thread_status status; + struct squidaio_request_t *current_req; + unsigned long requests; + int volatile exit; +}; + +static void squidaio_queue_request(squidaio_request_t *); +static void squidaio_cleanup_request(squidaio_request_t *); +static DWORD WINAPI squidaio_thread_loop( LPVOID lpParam ); +static void squidaio_do_open(squidaio_request_t *); +static void squidaio_do_read(squidaio_request_t *); +static void squidaio_do_write(squidaio_request_t *); +static void squidaio_do_close(squidaio_request_t *); +static void squidaio_do_stat(squidaio_request_t *); +static void squidaio_do_unlink(squidaio_request_t *); +#if USE_TRUNCATE +static void squidaio_do_truncate(squidaio_request_t *); +#endif +#if AIO_OPENDIR +static void *squidaio_do_opendir(squidaio_request_t *); +#endif +static void squidaio_debug(squidaio_request_t *); +static void squidaio_poll_queues(void); + +static squidaio_thread_t *threads = NULL; +static int squidaio_initialised = 0; + +#define AIO_LARGE_BUFS 16384 +#define AIO_MEDIUM_BUFS AIO_LARGE_BUFS >> 1 +#define AIO_SMALL_BUFS AIO_LARGE_BUFS >> 2 +#define AIO_TINY_BUFS AIO_LARGE_BUFS >> 3 +#define AIO_MICRO_BUFS 128 + +static MemPool *squidaio_large_bufs = NULL; /* 16K */ +static MemPool *squidaio_medium_bufs = NULL; /* 8K */ +static MemPool *squidaio_small_bufs = NULL; /* 4K */ +static MemPool *squidaio_tiny_bufs = NULL; /* 2K */ +static MemPool *squidaio_micro_bufs = NULL; /* 128K */ + +static int request_queue_len = 0; +static MemPool *squidaio_request_pool = NULL; +static MemPool *squidaio_thread_pool = NULL; +static squidaio_request_queue_t request_queue; +static struct { + squidaio_request_t *head, **tailp; +} request_queue2 = { + + NULL, &request_queue2.head +}; +static squidaio_request_queue_t done_queue; +static struct { + squidaio_request_t *head, **tailp; +} done_requests = { + + NULL, &done_requests.head +}; +static int done_fd = 0; +static int done_fd_read = 0; +static int done_signalled = 0; +static HANDLE main_thread; + +static MemPool * +squidaio_get_pool(int size) +{ + MemPool *p; + if (size <= AIO_LARGE_BUFS) { + if (size <= AIO_MICRO_BUFS) + p = squidaio_micro_bufs; + else if (size <= AIO_TINY_BUFS) + p = squidaio_tiny_bufs; + else if (size <= AIO_SMALL_BUFS) + p = squidaio_small_bufs; + else if (size <= AIO_MEDIUM_BUFS) + p = squidaio_medium_bufs; + else + p = squidaio_large_bufs; + } else + p = NULL; + return p; +} + +void * +squidaio_xmalloc(int size) +{ + void *p; + MemPool *pool; + + if ((pool = squidaio_get_pool(size)) != NULL) { + p = memPoolAlloc(pool); + } else + p = xmalloc(size); + + return p; +} + +static char * +squidaio_xstrdup(const char *str) +{ + char *p; + int len = strlen(str) + 1; + + p = squidaio_xmalloc(len); + strncpy(p, str, len); + + return p; +} + +void +squidaio_xfree(void *p, int size) +{ + MemPool *pool; + + if ((pool = squidaio_get_pool(size)) != NULL) { + memPoolFree(pool, p); + } else + xfree(p); +} + +static void +squidaio_xstrfree(char *str) +{ + MemPool *pool; + int len = strlen(str) + 1; + + if ((pool = squidaio_get_pool(len)) != NULL) { + memPoolFree(pool, str); + } else + xfree(str); +} + +static void +squidaio_fdhandler(int fd, void *data) +{ + char junk[256]; + int x; + fde *F = &fd_table[done_fd_read]; + if ((x = FD_READ_METHOD(done_fd_read, junk, sizeof(junk))) > 0) + F->bytes_read += x; + commSetSelect(fd, COMM_SELECT_READ, squidaio_fdhandler, NULL, 0); +} + +void +squidaio_init(void) +{ + int i; + int done_pipe[2]; + squidaio_thread_t *threadp; + + if (squidaio_initialised) + return; + + if (!DuplicateHandle(GetCurrentProcess(), /* pseudo handle, don't close */ + GetCurrentThread(), /* pseudo handle to copy */ + GetCurrentProcess(),/* pseudo handle, don't close */ + &main_thread, + 0, /* required access */ + FALSE, /* child process's don't inherit the handle */ + DUPLICATE_SAME_ACCESS)) { + /* spit errors */ + fatal("couldn't get current thread handle\n"); + } + /* Initialize request queue */ + if ((request_queue.mutex = CreateMutex(NULL, /* no inheritance */ + FALSE, /* start unowned (as per mutex_init) */ + NULL) /* no name */ + ) == NULL) { + fatal("failed to create mutex\n"); + } + if ((request_queue.cond = CreateEvent(NULL, /* no inheritance */ + FALSE, /* auto signal reset - which I think is pthreads like ? */ + FALSE, /* start non signaled */ + NULL) /* no name */ + ) == NULL) { + fatal("failed to create condition event variable.\n"); + } + request_queue.head = NULL; + request_queue.tailp = &request_queue.head; + request_queue.requests = 0; + request_queue.blocked = 0; + + /* Initialize done queue */ + if ((done_queue.mutex = CreateMutex(NULL, /* no inheritance */ + FALSE, /* start unowned (as per mutex_init) */ + NULL) /* no name */ + ) == NULL) { + fatal("failed to create mutex\n"); + } + if ((done_queue.cond = CreateEvent(NULL, /* no inheritance */ + TRUE, /* manually signaled - which I think is pthreads like ? */ + FALSE, /* start non signaled */ + NULL) /* no name */ + ) == NULL) { + fatal("failed to create condition event variable.\n"); + } + done_queue.head = NULL; + done_queue.tailp = &done_queue.head; + done_queue.requests = 0; + done_queue.blocked = 0; + + /* Initialize done pipe signal */ + pipe(done_pipe); + done_fd = done_pipe[1]; + done_fd_read = done_pipe[0]; + fd_open(done_fd_read, FD_PIPE, "async-io completion event: main"); + fd_open(done_fd, FD_PIPE, "async-io completion event: threads"); + commSetNonBlocking(done_pipe[0]); + commSetNonBlocking(done_pipe[1]); + commSetSelect(done_pipe[0], COMM_SELECT_READ, squidaio_fdhandler, NULL, 0); + + /* Create threads and get them to sit in their wait loop */ + squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t)); + if (squidaio_nthreads == 0) { + int j = 16; + for (i = 0; i < n_asyncufs_dirs; i++) { + squidaio_nthreads += j; + j = j * 2 / 3; + if (j < 4) + j = 4; + } + } + squidaio_magic1 = squidaio_nthreads * MAGIC1_FACTOR; + squidaio_magic2 = squidaio_nthreads * MAGIC2_FACTOR; + for (i = 0; i < squidaio_nthreads; i++) { + threadp = memPoolAlloc(squidaio_thread_pool); + threadp->status = _THREAD_STARTING; + threadp->current_req = NULL; + threadp->requests = 0; + threadp->next = threads; + threads = threadp; + if ((threadp->thread = CreateThread(NULL, /* no security attributes */ + 0, /* use default stack size */ + squidaio_thread_loop, /* thread function */ + threadp, /* argument to thread function */ + 0, /* use default creation flags */ + &(threadp->dwThreadId)) /* returns the thread identifier */ + ) == NULL) { + fprintf(stderr, "Thread creation failed\n"); + threadp->status = _THREAD_FAILED; + continue; + } + /* Set the new thread priority above parent process */ + SetThreadPriority(threadp->thread,THREAD_PRIORITY_ABOVE_NORMAL); + } + + /* Create request pool */ + squidaio_request_pool = memPoolCreate("aio_request", sizeof(squidaio_request_t)); + squidaio_large_bufs = memPoolCreate("squidaio_large_bufs", AIO_LARGE_BUFS); + squidaio_medium_bufs = memPoolCreate("squidaio_medium_bufs", AIO_MEDIUM_BUFS); + squidaio_small_bufs = memPoolCreate("squidaio_small_bufs", AIO_SMALL_BUFS); + squidaio_tiny_bufs = memPoolCreate("squidaio_tiny_bufs", AIO_TINY_BUFS); + squidaio_micro_bufs = memPoolCreate("squidaio_micro_bufs", AIO_MICRO_BUFS); + + squidaio_initialised = 1; +} + +void +squidaio_shutdown(void) +{ + squidaio_thread_t *threadp; + int i; + HANDLE * hthreads; + + if (!squidaio_initialised) + return; + + /* This is the same as in squidaio_sync */ + do { + squidaio_poll_queues(); + } while (request_queue_len > 0); + + hthreads = (HANDLE *) xcalloc (squidaio_nthreads, sizeof (HANDLE)); + threadp = threads; + for (i = 0; i < squidaio_nthreads; i++) { + threadp->exit = 1; + hthreads[i] = threadp->thread; + threadp = threadp->next; + } + ReleaseMutex(request_queue.mutex); + ResetEvent(request_queue.cond); + ReleaseMutex(done_queue.mutex); + ResetEvent(done_queue.cond); + Sleep(0); + + WaitForMultipleObjects(squidaio_nthreads, hthreads, TRUE, 2000); + for (i = 0; i < squidaio_nthreads; i++) { + CloseHandle(hthreads[i]); + } + CloseHandle(main_thread); + xfree(hthreads); + + close(done_fd); + close(done_fd_read); + fd_close(done_fd); + fd_close(done_fd_read); +} + +static DWORD WINAPI +squidaio_thread_loop(LPVOID lpParam) +{ + squidaio_thread_t *threadp = lpParam; + squidaio_request_t *request; + HANDLE cond; /* local copy of the event queue because win32 event handles + * don't atomically release the mutex as cond variables do. */ + + /* lock the thread info */ + if (WAIT_FAILED == WaitForSingleObject(request_queue.mutex, INFINITE)) { + fatal("Can't get ownership of mutex\n"); + } + /* duplicate the handle */ + if (!DuplicateHandle(GetCurrentProcess(), /* pseudo handle, don't close */ + request_queue.cond, /* handle to copy */ + GetCurrentProcess(), /* pseudo handle, don't close */ + &cond, + 0, /* required access */ + FALSE, /* child process's don't inherit the handle */ + DUPLICATE_SAME_ACCESS)) + fatal("Can't duplicate mutex handle\n"); + if (!ReleaseMutex(request_queue.mutex)) { + CloseHandle(cond); + fatal("Can't release mutex\n"); + } + Sleep(0); + + while (1) { + DWORD rv; + threadp->current_req = request = NULL; + request = NULL; + /* Get a request to process */ + threadp->status = _THREAD_WAITING; + if (threadp->exit) { + CloseHandle(request_queue.mutex); + CloseHandle(cond); + return 0; + } + rv = WaitForSingleObject(request_queue.mutex, INFINITE); + if (rv == WAIT_FAILED) { + CloseHandle(cond); + return 1; + } + + while (!request_queue.head) { + if (!ReleaseMutex(request_queue.mutex)) { + CloseHandle(cond); + threadp->status = _THREAD_FAILED; + return 1; + } + rv = WaitForSingleObject(cond, INFINITE); + if (rv == WAIT_FAILED) { + CloseHandle(cond); + return 1; + } + rv = WaitForSingleObject(request_queue.mutex, INFINITE); + if (rv == WAIT_FAILED) { + CloseHandle(cond); + return 1; + } + } + request = request_queue.head; + if (request) + request_queue.head = request->next; + if (!request_queue.head) + request_queue.tailp = &request_queue.head; + if (!ReleaseMutex(request_queue.mutex)) { + CloseHandle(cond); + return 1; + } + /* process the request */ + threadp->status = _THREAD_BUSY; + request->next = NULL; + threadp->current_req = request; + errno = 0; + if (!request->cancelled) { + switch (request->request_type) { + case _AIO_OP_OPEN: + squidaio_do_open(request); + break; + case _AIO_OP_READ: + squidaio_do_read(request); + break; + case _AIO_OP_WRITE: + squidaio_do_write(request); + break; + case _AIO_OP_CLOSE: + squidaio_do_close(request); + break; + case _AIO_OP_UNLINK: + squidaio_do_unlink(request); + break; +#if USE_TRUNCATE + case _AIO_OP_TRUNCATE: + squidaio_do_truncate(request); + break; +#endif +#if AIO_OPENDIR /* Opendir not implemented yet */ + case _AIO_OP_OPENDIR: + squidaio_do_opendir(request); + break; +#endif + case _AIO_OP_STAT: + squidaio_do_stat(request); + break; + default: + request->ret = -1; + request->err = EINVAL; + break; + } + } else { /* cancelled */ + request->ret = -1; + request->err = EINTR; + } + threadp->status = _THREAD_DONE; + /* put the request in the done queue */ + rv = WaitForSingleObject(done_queue.mutex, INFINITE); + if (rv == WAIT_FAILED) { + CloseHandle(cond); + return 1; + } + *done_queue.tailp = request; + done_queue.tailp = &request->next; + if (!ReleaseMutex(done_queue.mutex)) { + CloseHandle(cond); + return 1; + } + if (!done_signalled) { + fde *F = &fd_table[done_fd]; + int x; + done_signalled = 1; + if ((x = FD_WRITE_METHOD(done_fd, "!", 1)) > 0) + F->bytes_written += x; + } + threadp->requests++; +/* Relinquish the remainder of thread time slice to any other thread + of equal priority that is ready to run. + */ + Sleep(0); + } /* while forever */ + CloseHandle(cond); + return 0; +} /* squidaio_thread_loop */ + +static void +squidaio_queue_request(squidaio_request_t * request) +{ + static int high_start = 0; + debug(43, 9) ("squidaio_queue_request: %p type=%d result=%p\n", + request, request->request_type, request->resultp); + /* Mark it as not executed (failing result, no error) */ + request->ret = -1; + request->err = 0; + /* Internal housekeeping */ + request_queue_len += 1; + request->resultp->_data = request; + /* Play some tricks with the request_queue2 queue */ + request->next = NULL; + if (WaitForSingleObject(request_queue.mutex, 0) == WAIT_OBJECT_0) { + if (request_queue2.head) { + /* Grab blocked requests */ + *request_queue.tailp = request_queue2.head; + request_queue.tailp = request_queue2.tailp; + } + /* Enqueue request */ + *request_queue.tailp = request; + request_queue.tailp = &request->next; + if (!SetEvent(request_queue.cond)) + fatal("couldn't push queue\n"); + if (!ReleaseMutex(request_queue.mutex)) { + /* unexpected error */ + fatal("couldn't push queue\n"); + } + if (request_queue2.head) { + /* Clear queue of blocked requests */ + request_queue2.head = NULL; + request_queue2.tailp = &request_queue2.head; + } + } else { + /* Oops, the request queue is blocked, use request_queue2 */ + *request_queue2.tailp = request; + request_queue2.tailp = &request->next; + } + if (request_queue2.head) { + static int filter = 0; + static int filter_limit = 8; + if (++filter >= filter_limit) { + filter_limit += filter; + filter = 0; + debug(43, 1) ("squidaio_queue_request: WARNING - Queue congestion\n"); + } + } + /* Warn if out of threads */ + if (request_queue_len > MAGIC1) { + static int last_warn = 0; + static int queue_high, queue_low; + if (high_start == 0) { + high_start = squid_curtime; + queue_high = request_queue_len; + queue_low = request_queue_len; + } + if (request_queue_len > queue_high) + queue_high = request_queue_len; + if (request_queue_len < queue_low) + queue_low = request_queue_len; + if (squid_curtime >= (last_warn + 15) && + squid_curtime >= (high_start + 5)) { + debug(43, 1) ("squidaio_queue_request: WARNING - Disk I/O overloading\n"); + if (squid_curtime >= (high_start + 15)) + debug(43, 1) ("squidaio_queue_request: Queue Length: current=%d, high=%d, low=%d, duration=%ld\n", + request_queue_len, queue_high, queue_low, (long int) (squid_curtime - high_start)); + last_warn = squid_curtime; + } + } else { + high_start = 0; + } + /* Warn if seriously overloaded */ + if (request_queue_len > RIDICULOUS_LENGTH) { + debug(43, 0) ("squidaio_queue_request: Async request queue growing uncontrollably!\n"); + debug(43, 0) ("squidaio_queue_request: Syncing pending I/O operations.. (blocking)\n"); + squidaio_sync(); + debug(43, 0) ("squidaio_queue_request: Synced\n"); + } +} /* squidaio_queue_request */ + +static void +squidaio_cleanup_request(squidaio_request_t * requestp) +{ + squidaio_result_t *resultp = requestp->resultp; + int cancelled = requestp->cancelled; + + /* Free allocated structures and copy data back to user space if the */ + /* request hasn't been cancelled */ + switch (requestp->request_type) { + case _AIO_OP_STAT: + if (!cancelled && requestp->ret == 0) + xmemcpy(requestp->statp, requestp->tmpstatp, sizeof(struct stat)); + squidaio_xfree(requestp->tmpstatp, sizeof(struct stat)); + squidaio_xstrfree(requestp->path); + break; + case _AIO_OP_OPEN: + if (cancelled && requestp->ret >= 0) + /* The open() was cancelled but completed */ + close(requestp->ret); + squidaio_xstrfree(requestp->path); + break; + case _AIO_OP_CLOSE: + if (cancelled && requestp->ret < 0) + /* The close() was cancelled and never got executed */ + close(requestp->fd); + break; + case _AIO_OP_UNLINK: + case _AIO_OP_TRUNCATE: + case _AIO_OP_OPENDIR: + squidaio_xstrfree(requestp->path); + break; + case _AIO_OP_READ: + break; + case _AIO_OP_WRITE: + break; + default: + break; + } + if (resultp != NULL && !cancelled) { + resultp->aio_return = requestp->ret; + resultp->aio_errno = requestp->err; + } + memPoolFree(squidaio_request_pool, requestp); +} /* squidaio_cleanup_request */ + + +int +squidaio_cancel(squidaio_result_t * resultp) +{ + squidaio_request_t *request = resultp->_data; + + if (request && request->resultp == resultp) { + debug(43, 9) ("squidaio_cancel: %p type=%d result=%p\n", + request, request->request_type, request->resultp); + request->cancelled = 1; + request->resultp = NULL; + resultp->_data = NULL; + return 0; + } + return 1; +} /* squidaio_cancel */ + + +int +squidaio_open(const char *path, int oflag, mode_t mode, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->path = (char *) squidaio_xstrdup(path); + requestp->oflag = oflag; + requestp->mode = mode; + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_OPEN; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_open(squidaio_request_t * requestp) +{ + requestp->ret = open(requestp->path, requestp->oflag, requestp->mode); + requestp->err = errno; +} + + +int +squidaio_read(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->fd = fd; + requestp->bufferp = bufp; + requestp->buflen = bufs; + requestp->offset = offset; + requestp->whence = whence; + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_READ; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_read(squidaio_request_t * requestp) +{ + lseek(requestp->fd, requestp->offset, requestp->whence); +#ifdef _SQUID_MSWIN_ + if (!ReadFile((HANDLE)_get_osfhandle(requestp->fd), requestp->bufferp, + requestp->buflen, (LPDWORD)&requestp->ret, NULL)) { + WIN32_maperror(GetLastError()); + requestp->ret = -1; + } +#else + requestp->ret = read(requestp->fd, requestp->bufferp, requestp->buflen); +#endif + requestp->err = errno; +} + + +int +squidaio_write(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->fd = fd; + requestp->bufferp = bufp; + requestp->buflen = bufs; + requestp->offset = offset; + requestp->whence = whence; + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_WRITE; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_write(squidaio_request_t * requestp) +{ +#ifdef _SQUID_MSWIN_ + if (!WriteFile((HANDLE)_get_osfhandle(requestp->fd), requestp->bufferp, + requestp->buflen, (LPDWORD)&requestp->ret, NULL)) { + WIN32_maperror(GetLastError()); + requestp->ret = -1; + } +#else + requestp->ret = write(requestp->fd, requestp->bufferp, requestp->buflen); +#endif + requestp->err = errno; +} + + +int +squidaio_close(int fd, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->fd = fd; + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_CLOSE; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_close(squidaio_request_t * requestp) +{ + if((requestp->ret = close(requestp->fd)) < 0) { + debug(43, 0) ("squidaio_do_close: FD %d, errno %d\n", requestp->fd, errno); + close(requestp->fd); + } + requestp->err = errno; +} + + +int +squidaio_stat(const char *path, struct stat *sb, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->path = (char *) squidaio_xstrdup(path); + requestp->statp = sb; + requestp->tmpstatp = (struct stat *) squidaio_xmalloc(sizeof(struct stat)); + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_STAT; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_stat(squidaio_request_t * requestp) +{ + requestp->ret = stat(requestp->path, requestp->tmpstatp); + requestp->err = errno; +} + + +int +squidaio_unlink(const char *path, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->path = squidaio_xstrdup(path); + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_UNLINK; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_unlink(squidaio_request_t * requestp) +{ + requestp->ret = unlink(requestp->path); + requestp->err = errno; +} + + +#if USE_TRUNCATE +int +squidaio_truncate(const char *path, off_t length, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + + requestp = memPoolAlloc(squidaio_request_pool); + requestp->path = (char *) squidaio_xstrdup(path); + requestp->offset = length; + requestp->resultp = resultp; + requestp->request_type = _AIO_OP_TRUNCATE; + requestp->cancelled = 0; + + squidaio_queue_request(requestp); + return 0; +} + + +static void +squidaio_do_truncate(squidaio_request_t * requestp) +{ + requestp->ret = truncate(requestp->path, requestp->offset); + requestp->err = errno; +} +#endif + + +#if AIO_OPENDIR +/* XXX squidaio_opendir NOT implemented yet.. */ + +int +squidaio_opendir(const char *path, squidaio_result_t * resultp) +{ + squidaio_request_t *requestp; + int len; + + requestp = memPoolAlloc(squidaio_request_pool); + return -1; +} + +static void +squidaio_do_opendir(squidaio_request_t * requestp) +{ + /* NOT IMPLEMENTED */ +} + +#endif + +static void +squidaio_poll_queues(void) +{ + /* kick "overflow" request queue */ + if (request_queue2.head && + (WaitForSingleObject(request_queue.mutex, 0) == WAIT_OBJECT_0)) { + *request_queue.tailp = request_queue2.head; + request_queue.tailp = request_queue2.tailp; + if (!SetEvent(request_queue.cond)) + fatal("couldn't push queue\n"); + if (!ReleaseMutex(request_queue.mutex)) { + /* unexpected error */ + } + request_queue2.head = NULL; + request_queue2.tailp = &request_queue2.head; + } + /* Give up the CPU to allow the threads to do their work */ + if (done_queue.head || request_queue.head) + Sleep(0); + /* poll done queue */ + if (done_queue.head && + (WaitForSingleObject(done_queue.mutex, 0) == WAIT_OBJECT_0)) { + struct squidaio_request_t *requests = done_queue.head; + done_queue.head = NULL; + done_queue.tailp = &done_queue.head; + if (!ReleaseMutex(done_queue.mutex)) { + /* unexpected error */ + } + *done_requests.tailp = requests; + request_queue_len -= 1; + while (requests->next) { + requests = requests->next; + request_queue_len -= 1; + } + done_requests.tailp = &requests->next; + } +} + +squidaio_result_t * +squidaio_poll_done(void) +{ + squidaio_request_t *request; + squidaio_result_t *resultp; + int cancelled; + int polled = 0; + + AIO_REPOLL: + request = done_requests.head; + if (request == NULL && !polled) { + if (done_signalled) { + char junk[256]; + fde *F = &fd_table[done_fd_read]; + int x; + if ((x = FD_READ_METHOD(done_fd_read, junk, sizeof(junk))) > 0) + F->bytes_read += x; + done_signalled = 0; + } + squidaio_poll_queues(); + polled = 1; + request = done_requests.head; + } + if (!request) { + return NULL; + } + debug(43, 9) ("squidaio_poll_done: %p type=%d result=%p\n", + request, request->request_type, request->resultp); + done_requests.head = request->next; + if (!done_requests.head) + done_requests.tailp = &done_requests.head; + resultp = request->resultp; + cancelled = request->cancelled; + squidaio_debug(request); + debug(43, 5) ("DONE: %d -> %d\n", request->ret, request->err); + squidaio_cleanup_request(request); + if (cancelled) + goto AIO_REPOLL; + return resultp; +} /* squidaio_poll_done */ + +int +squidaio_operations_pending(void) +{ + return request_queue_len + (done_requests.head ? 1 : 0); +} + +int +squidaio_sync(void) +{ + /* XXX This might take a while if the queue is large.. */ + do { + squidaio_poll_queues(); + } while (request_queue_len > 0); + return squidaio_operations_pending(); +} + +int +squidaio_get_queue_len(void) +{ + return request_queue_len; +} + +static void +squidaio_debug(squidaio_request_t * request) +{ + switch (request->request_type) { + case _AIO_OP_OPEN: + debug(43, 5) ("OPEN of %s to FD %d\n", request->path, request->ret); + break; + case _AIO_OP_READ: + debug(43, 5) ("READ on fd: %d\n", request->fd); + break; + case _AIO_OP_WRITE: + debug(43, 5) ("WRITE on fd: %d\n", request->fd); + break; + case _AIO_OP_CLOSE: + debug(43, 5) ("CLOSE of fd: %d\n", request->fd); + break; + case _AIO_OP_UNLINK: + debug(43, 5) ("UNLINK of %s\n", request->path); + break; + case _AIO_OP_TRUNCATE: + debug(43, 5) ("UNLINK of %s\n", request->path); + break; + default: + break; + } +} + +void +squidaio_stats(StoreEntry * sentry) +{ + squidaio_thread_t *threadp; + int i; + + if (!squidaio_initialised) + return; + + storeAppendPrintf(sentry, "\n\nThreads Status:\n"); + storeAppendPrintf(sentry, "#\tID\t# Requests\n"); + + threadp = threads; + for (i = 0; i < squidaio_nthreads; i++) { + storeAppendPrintf(sentry, "%i\t0x%lx\t%ld\n", i + 1, threadp->dwThreadId, threadp->requests); + threadp = threadp->next; + } +} Index: squid/src/fs/awin32/async_io.c diff -u /dev/null squid/src/fs/awin32/async_io.c:1.1.62.10 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/async_io.c Sun Jul 10 01:56:32 2005 @@ -0,0 +1,373 @@ + +/* + * $Id$ + * + * DEBUG: section 32 Asynchronous Disk I/O + * AUTHOR: Pete Bentley + * AUTHOR: Stewart Forster + * + * 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 "store_asyncufs.h" + +#define _AIO_OPEN 0 +#define _AIO_READ 1 +#define _AIO_WRITE 2 +#define _AIO_CLOSE 3 +#define _AIO_UNLINK 4 +#define _AIO_TRUNCATE 4 +#define _AIO_OPENDIR 5 +#define _AIO_STAT 6 + +typedef struct squidaio_ctrl_t { + struct squidaio_ctrl_t *next; + int fd; + int operation; + AIOCB *done_handler; + void *done_handler_data; + squidaio_result_t result; + int len; + char *bufp; + FREE *free_func; + dlink_node node; +} squidaio_ctrl_t; + +static struct { + int open; + int close; + int cancel; + int write; + int read; + int stat; + int unlink; + int check_callback; +} squidaio_counts; + +typedef struct squidaio_unlinkq_t { + char *path; + struct squidaio_unlinkq_t *next; +} squidaio_unlinkq_t; + +static dlink_list used_list; +static int initialised = 0; +static OBJH aioStats; +static MemPool *squidaio_ctrl_pool; + +void +aioInit(void) +{ + if (initialised) + return; + squidaio_ctrl_pool = memPoolCreate("aio_ctrl", sizeof(squidaio_ctrl_t)); + cachemgrRegister("squidaio_counts", "Async IO Function Counters", + aioStats, 0, 1); + initialised = 1; +} + +void +aioDone(void) +{ + squidaio_shutdown(); + memPoolDestroy(squidaio_ctrl_pool); + initialised = 0; +} + +void +aioOpen(const char *path, int oflag, mode_t mode, AIOCB * callback, void *callback_data) +{ + squidaio_ctrl_t *ctrlp; + + assert(initialised); + squidaio_counts.open++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = -2; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_OPEN; + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_open(path, oflag, mode, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); + return; +} + +void +aioClose(int fd) +{ + squidaio_ctrl_t *ctrlp; + + assert(initialised); + squidaio_counts.close++; + aioCancel(fd); + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = fd; + ctrlp->done_handler = NULL; + ctrlp->done_handler_data = NULL; + ctrlp->operation = _AIO_CLOSE; + ctrlp->result.data = ctrlp; + squidaio_close(fd, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); + return; +} + +void +aioCancel(int fd) +{ + squidaio_ctrl_t *ctrlp; + AIOCB *done_handler; + void *their_data; + dlink_node *m, *next; + + assert(initialised); + squidaio_counts.cancel++; + for (m = used_list.head; m; m = next) { + next = m->next; + ctrlp = m->data; + if (ctrlp->fd != fd) + continue; + + squidaio_cancel(&ctrlp->result); + + if ((done_handler = ctrlp->done_handler)) { + their_data = ctrlp->done_handler_data; + ctrlp->done_handler = NULL; + ctrlp->done_handler_data = NULL; + debug(32, 0) ("this be aioCancel. Danger ahead!\n"); + if (cbdataValid(their_data)) + done_handler(fd, their_data, NULL, -2, -2); + cbdataUnlock(their_data); + /* free data if requested to aioWrite() */ + if (ctrlp->free_func) + ctrlp->free_func(ctrlp->bufp); + /* free temporary read buffer */ + if (ctrlp->operation == _AIO_READ) + squidaio_xfree(ctrlp->bufp, ctrlp->len); + } + dlinkDelete(m, &used_list); + memPoolFree(squidaio_ctrl_pool, ctrlp); + } +} + + +void +aioWrite(int fd, off_t offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) +{ + squidaio_ctrl_t *ctrlp; + int seekmode; + + assert(initialised); + squidaio_counts.write++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = fd; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_WRITE; + ctrlp->bufp = bufp; + ctrlp->free_func = free_func; + if (offset >= 0) + seekmode = SEEK_SET; + else { + seekmode = SEEK_END; + offset = 0; + } + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_write(fd, bufp, len, offset, seekmode, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); +} /* aioWrite */ + + +void +aioRead(int fd, off_t offset, int len, AIOCB * callback, void *callback_data) +{ + squidaio_ctrl_t *ctrlp; + int seekmode; + + assert(initialised); + squidaio_counts.read++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = fd; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_READ; + ctrlp->len = len; + ctrlp->bufp = squidaio_xmalloc(len); + if (offset >= 0) + seekmode = SEEK_SET; + else { + seekmode = SEEK_CUR; + offset = 0; + } + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_read(fd, ctrlp->bufp, len, offset, seekmode, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); + return; +} /* aioRead */ + +void +aioStat(char *path, struct stat *sb, AIOCB * callback, void *callback_data) +{ + squidaio_ctrl_t *ctrlp; + + assert(initialised); + squidaio_counts.stat++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = -2; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_STAT; + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_stat(path, sb, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); + return; +} /* aioStat */ + +void +aioUnlink(const char *path, AIOCB * callback, void *callback_data) +{ + squidaio_ctrl_t *ctrlp; + assert(initialised); + squidaio_counts.unlink++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = -2; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_UNLINK; + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_unlink(path, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); +} /* aioUnlink */ + +#if USE_TRUNCATE +void +aioTruncate(const char *path, off_t length, AIOCB * callback, void *callback_data) +{ + squidaio_ctrl_t *ctrlp; + assert(initialised); + squidaio_counts.unlink++; + ctrlp = memPoolAlloc(squidaio_ctrl_pool); + ctrlp->fd = -2; + ctrlp->done_handler = callback; + ctrlp->done_handler_data = callback_data; + ctrlp->operation = _AIO_TRUNCATE; + cbdataLock(callback_data); + ctrlp->result.data = ctrlp; + squidaio_truncate(path, length, &ctrlp->result); + dlinkAdd(ctrlp, &ctrlp->node, &used_list); +} /* aioTruncate */ +#endif + + +int +aioCheckCallbacks(SwapDir * SD) +{ + squidaio_result_t *resultp; + squidaio_ctrl_t *ctrlp; + AIOCB *done_handler; + void *their_data; + int retval = 0; + + assert(initialised); + squidaio_counts.check_callback++; + for (;;) { + if ((resultp = squidaio_poll_done()) == NULL) + break; + ctrlp = (squidaio_ctrl_t *) resultp->data; + if (ctrlp == NULL) + continue; /* XXX Should not happen */ + dlinkDelete(&ctrlp->node, &used_list); + if ((done_handler = ctrlp->done_handler)) { + their_data = ctrlp->done_handler_data; + ctrlp->done_handler = NULL; + ctrlp->done_handler_data = NULL; + if (cbdataValid(their_data)) { + retval = 1; /* Return that we've actually done some work */ + done_handler(ctrlp->fd, their_data, ctrlp->bufp, + ctrlp->result.aio_return, ctrlp->result.aio_errno); + } else { + if (ctrlp->operation == _AIO_OPEN) { + /* The open operation was aborted.. */ + int fd = ctrlp->result.aio_return; + if (fd >= 0) + aioClose(fd); + } + } + cbdataUnlock(their_data); + } + /* free data if requested to aioWrite() */ + if (ctrlp->free_func) + ctrlp->free_func(ctrlp->bufp); + /* free temporary read buffer */ + if (ctrlp->operation == _AIO_READ) + squidaio_xfree(ctrlp->bufp, ctrlp->len); + memPoolFree(squidaio_ctrl_pool, ctrlp); + } + return retval; +} + +void +aioStats(StoreEntry * sentry) +{ + storeAppendPrintf(sentry, "ASYNC IO Counters:\n"); + storeAppendPrintf(sentry, "Operation\t# Requests\n"); + storeAppendPrintf(sentry, "open\t%d\n", squidaio_counts.open); + storeAppendPrintf(sentry, "close\t%d\n", squidaio_counts.close); + storeAppendPrintf(sentry, "cancel\t%d\n", squidaio_counts.cancel); + storeAppendPrintf(sentry, "write\t%d\n", squidaio_counts.write); + storeAppendPrintf(sentry, "read\t%d\n", squidaio_counts.read); + storeAppendPrintf(sentry, "stat\t%d\n", squidaio_counts.stat); + storeAppendPrintf(sentry, "unlink\t%d\n", squidaio_counts.unlink); + storeAppendPrintf(sentry, "check_callback\t%d\n", squidaio_counts.check_callback); + storeAppendPrintf(sentry, "queue\t%d\n", squidaio_get_queue_len()); + squidaio_stats(sentry); +} + +/* Flush all pending I/O */ +void +aioSync(SwapDir * SD) +{ + if (!initialised) + return; /* nothing to do then */ + /* Flush all pending operations */ + debug(32, 1) ("aioSync: flushing pending I/O operations\n"); + do { + aioCheckCallbacks(SD); + } while (squidaio_sync()); + debug(32, 1) ("aioSync: done\n"); +} + +int +aioQueueSize(void) +{ + return memPoolInUseCount(squidaio_ctrl_pool); +} Index: squid/src/fs/awin32/store_asyncufs.h diff -u /dev/null squid/src/fs/awin32/store_asyncufs.h:1.1.62.9 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/store_asyncufs.h Sat Mar 26 03:11:20 2005 @@ -0,0 +1,143 @@ +/* + * store_aufs.h + * + * Internal declarations for the aufs routines + */ + +#ifndef __STORE_ASYNCUFS_H__ +#define __STORE_ASYNCUFS_H__ + +extern int n_asyncufs_dirs; +extern int squidaio_nthreads; +extern int squidaio_magic1; +extern int squidaio_magic2; + +/* Base number of threads if not specified to configure. + * Weighted by number of directories (see aiops.c) */ +#define THREAD_FACTOR 16 + +/* Queue limit where swapouts are deferred (load calculation) */ +#define MAGIC1_FACTOR 10 +#define MAGIC1 squidaio_magic1 +/* Queue limit where swapins are deferred (open/create fails) */ +#define MAGIC2_FACTOR 20 +#define MAGIC2 squidaio_magic2 + +/* Which operations to run async */ +#define ASYNC_OPEN 1 +#define ASYNC_CLOSE 0 +#define ASYNC_CREATE 1 +#define ASYNC_WRITE 0 +#define ASYNC_READ 1 + +struct _squidaio_result_t { + int aio_return; + int aio_errno; + void *_data; /* Internal housekeeping */ + void *data; /* Available to the caller */ +}; + +typedef struct _squidaio_result_t squidaio_result_t; + +typedef void AIOCB(int fd, void *cbdata, const char *buf, int aio_return, int aio_errno); + +void squidaio_init(void); +void squidaio_shutdown(void); +int squidaio_cancel(squidaio_result_t *); +int squidaio_open(const char *, int, mode_t, squidaio_result_t *); +int squidaio_read(int, char *, int, off_t, int, squidaio_result_t *); +int squidaio_write(int, char *, int, off_t, int, squidaio_result_t *); +int squidaio_close(int, squidaio_result_t *); +int squidaio_stat(const char *, struct stat *, squidaio_result_t *); +int squidaio_unlink(const char *, squidaio_result_t *); +int squidaio_truncate(const char *, off_t length, squidaio_result_t *); +int squidaio_opendir(const char *, squidaio_result_t *); +squidaio_result_t *squidaio_poll_done(void); +int squidaio_operations_pending(void); +int squidaio_sync(void); +int squidaio_get_queue_len(void); +void *squidaio_xmalloc(int size); +void squidaio_xfree(void *p, int size); +void squidaio_stats(StoreEntry *); + +void aioInit(void); +void aioDone(void); +void aioCancel(int); +void aioOpen(const char *, int, mode_t, AIOCB *, void *); +void aioClose(int); +void aioWrite(int, off_t offset, char *, int size, AIOCB *, void *, FREE *); +void aioRead(int, off_t offset, int size, AIOCB *, void *); +void aioStat(char *, struct stat *, AIOCB *, void *); +void aioUnlink(const char *, AIOCB *, void *); +void aioTruncate(const char *, off_t length, AIOCB *, void *); +int aioCheckCallbacks(SwapDir *); +void aioSync(SwapDir *); +int aioQueueSize(void); + +struct _squidaioinfo_t { + int swaplog_fd; + int l1; + int l2; + fileMap *map; + int suggest; +}; + +struct _squidaiostate_t { + int fd; + struct { + unsigned int close_request:1; + unsigned int reading:1; + unsigned int writing:1; + unsigned int opening:1; +#if !ASYNC_WRITE + unsigned int write_kicking:1; +#endif + unsigned int inreaddone:1; + } flags; + char *read_buf; + link_list *pending_writes; + link_list *pending_reads; +}; + +struct _queued_write { + char *buf; + size_t size; + off_t offset; + FREE *free_func; +}; + +struct _queued_read { + char *buf; + size_t size; + off_t offset; + STRCB *callback; + void *callback_data; +}; + +typedef struct _squidaioinfo_t squidaioinfo_t; +typedef struct _squidaiostate_t squidaiostate_t; + +/* The squidaio_state memory pools */ +extern MemPool *squidaio_state_pool; +extern MemPool *aufs_qread_pool; +extern MemPool *aufs_qwrite_pool; + +extern void storeAufsDirMapBitReset(SwapDir *, sfileno); +extern int storeAufsDirMapBitAllocate(SwapDir *); + +extern char *storeAufsDirFullPath(SwapDir * SD, sfileno filn, char *fullpath); +extern void storeAufsDirUnlinkFile(SwapDir *, sfileno); +extern void storeAufsDirReplAdd(SwapDir * SD, StoreEntry *); +extern void storeAufsDirReplRemove(StoreEntry *); + +/* + * Store IO stuff + */ +extern STOBJCREATE storeAufsCreate; +extern STOBJOPEN storeAufsOpen; +extern STOBJCLOSE storeAufsClose; +extern STOBJREAD storeAufsRead; +extern STOBJWRITE storeAufsWrite; +extern STOBJUNLINK storeAufsUnlink; + +#endif Index: squid/src/fs/awin32/store_dir_aufs.c diff -u /dev/null squid/src/fs/awin32/store_dir_aufs.c:1.1.62.20 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/store_dir_aufs.c Mon Mar 28 00:13:57 2005 @@ -0,0 +1,1958 @@ + +/* + * $Id$ + * + * DEBUG: section 47 Store Directory Routines + * AUTHOR: Duane Wessels + * + * 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 "store_asyncufs.h" + +#define DefaultLevelOneDirs 16 +#define DefaultLevelTwoDirs 256 +#define STORE_META_BUFSZ 4096 + +typedef struct _RebuildState RebuildState; +struct _RebuildState { + SwapDir *sd; + int n_read; + FILE *log; + int speed; + int curlvl1; + int curlvl2; + struct { + unsigned int need_to_validate:1; + unsigned int clean:1; + unsigned int init:1; + } flags; + int done; + int in_dir; + int fn; + struct dirent *entry; + DIR *td; + char fullpath[SQUID_MAXPATHLEN]; + char fullfilename[SQUID_MAXPATHLEN]; + struct _store_rebuild_data counts; +}; + +int n_asyncufs_dirs = 0; +static int *asyncufs_dir_index = NULL; +MemPool *squidaio_state_pool = NULL; +MemPool *aufs_qread_pool = NULL; +MemPool *aufs_qwrite_pool = NULL; +static int asyncufs_initialised = 0; + +static char *storeAufsDirSwapSubDir(SwapDir *, int subdirn); +static int storeAufsDirCreateDirectory(const char *path, int); +static int storeAufsDirVerifyCacheDirs(SwapDir *); +static int storeAufsDirVerifyDirectory(const char *path); +static void storeAufsDirCreateSwapSubDirs(SwapDir *); +static char *storeAufsDirSwapLogFile(SwapDir *, const char *); +static EVH storeAufsDirRebuildFromDirectory; +static EVH storeAufsDirRebuildFromSwapLog; +static int storeAufsDirGetNextFile(RebuildState *, sfileno *, int *size); +static StoreEntry *storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, + sfileno file_number, + squid_file_sz swap_file_sz, + time_t expires, + time_t timestamp, + time_t lastref, + time_t lastmod, + u_num32 refcount, + u_short flags, + int clean); +static void storeAufsDirRebuild(SwapDir * sd); +static void storeAufsDirCloseTmpSwapLog(SwapDir * sd); +static FILE *storeAufsDirOpenTmpSwapLog(SwapDir *, int *, int *); +static STLOGOPEN storeAufsDirOpenSwapLog; +static STINIT storeAufsDirInit; +static STFREE storeAufsDirFree; +static STLOGCLEANSTART storeAufsDirWriteCleanStart; +static STLOGCLEANNEXTENTRY storeAufsDirCleanLogNextEntry; +static STLOGCLEANWRITE storeAufsDirWriteCleanEntry; +static STLOGCLEANDONE storeAufsDirWriteCleanDone; +static STLOGCLOSE storeAufsDirCloseSwapLog; +static STLOGWRITE storeAufsDirSwapLog; +static STNEWFS storeAufsDirNewfs; +static STDUMP storeAufsDirDump; +static STMAINTAINFS storeAufsDirMaintain; +static STCHECKOBJ storeAufsDirCheckObj; +static STREFOBJ storeAufsDirRefObj; +static STUNREFOBJ storeAufsDirUnrefObj; +static QS rev_int_sort; +static int storeAufsDirClean(int swap_index); +static EVH storeAufsDirCleanEvent; +static int storeAufsFilenoBelongsHere(int fn, int F0, int F1, int F2); +static int storeAufsCleanupDoubleCheck(SwapDir *, StoreEntry *); +static void storeAufsDirStats(SwapDir *, StoreEntry *); +static void storeAufsDirInitBitmap(SwapDir *); +static int storeAufsDirValidFileno(SwapDir *, sfileno, int); + +/* The MAIN externally visible function */ +STSETUP storeFsSetup_awin32; + +/* + * These functions were ripped straight out of the heart of store_dir.c. + * They assume that the given filenum is on a asyncufs partiton, which may or + * may not be true.. + * XXX this evilness should be tidied up at a later date! + */ + +static int +storeAufsDirMapBitTest(SwapDir * SD, sfileno filn) +{ + squidaioinfo_t *aioinfo; + aioinfo = (squidaioinfo_t *) SD->fsdata; + return file_map_bit_test(aioinfo->map, filn); +} + +static void +storeAufsDirMapBitSet(SwapDir * SD, sfileno filn) +{ + squidaioinfo_t *aioinfo; + aioinfo = (squidaioinfo_t *) SD->fsdata; + file_map_bit_set(aioinfo->map, filn); +} + +void +storeAufsDirMapBitReset(SwapDir * SD, sfileno filn) +{ + squidaioinfo_t *aioinfo; + aioinfo = (squidaioinfo_t *) SD->fsdata; + /* + * We have to test the bit before calling file_map_bit_reset. + * file_map_bit_reset doesn't do bounds checking. It assumes + * filn is a valid file number, but it might not be because + * the map is dynamic in size. Also clearing an already clear + * bit puts the map counter of-of-whack. + */ + if (file_map_bit_test(aioinfo->map, filn)) + file_map_bit_reset(aioinfo->map, filn); +} + +int +storeAufsDirMapBitAllocate(SwapDir * SD) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) SD->fsdata; + int fn; + fn = file_map_allocate(aioinfo->map, aioinfo->suggest); + file_map_bit_set(aioinfo->map, fn); + aioinfo->suggest = fn + 1; + return fn; +} + +/* + * Initialise the asyncufs bitmap + * + * If there already is a bitmap, and the numobjects is larger than currently + * configured, we allocate a new bitmap and 'grow' the old one into it. + */ +static void +storeAufsDirInitBitmap(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + + if (aioinfo->map == NULL) { + /* First time */ + aioinfo->map = file_map_create(); + } else if (aioinfo->map->max_n_files) { + /* it grew, need to expand */ + /* XXX We don't need it anymore .. */ + } + /* else it shrunk, and we leave the old one in place */ +} + +static char * +storeAufsDirSwapSubDir(SwapDir * sd, int subdirn) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + + LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); + assert(0 <= subdirn && subdirn < aioinfo->l1); + snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%02X", sd->path, subdirn); + return fullfilename; +} + +static int +storeAufsDirCreateDirectory(const char *path, int should_exist) +{ + int created = 0; + struct stat st; + getCurrentTime(); + if (0 == stat(path, &st)) { + if (S_ISDIR(st.st_mode)) { + debug(47, should_exist ? 3 : 1) ("%s exists\n", path); + } else { + fatalf("Swap directory %s is not a directory.", path); + } +#ifdef _SQUID_MSWIN_ + } else if (0 == mkdir(path)) { +#else + } else if (0 == mkdir(path, 0755)) { +#endif + debug(47, should_exist ? 1 : 3) ("%s created\n", path); + created = 1; + } else { + fatalf("Failed to make swap directory %s: %s", + path, xstrerror()); + } + return created; +} + +static int +storeAufsDirVerifyDirectory(const char *path) +{ + struct stat sb; + if (stat(path, &sb) < 0) { + debug(47, 0) ("%s: %s\n", path, xstrerror()); + return -1; + } + if (S_ISDIR(sb.st_mode) == 0) { + debug(47, 0) ("%s is not a directory\n", path); + return -1; + } + return 0; +} + +/* + * This function is called by storeAufsDirInit(). If this returns < 0, + * then Squid exits, complains about swap directories not + * existing, and instructs the admin to run 'squid -z' + */ +static int +storeAufsDirVerifyCacheDirs(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + int j; + const char *path = sd->path; + + if (storeAufsDirVerifyDirectory(path) < 0) + return -1; + for (j = 0; j < aioinfo->l1; j++) { + path = storeAufsDirSwapSubDir(sd, j); + if (storeAufsDirVerifyDirectory(path) < 0) + return -1; + } + return 0; +} + +static void +storeAufsDirCreateSwapSubDirs(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + int i, k; + int should_exist; + LOCAL_ARRAY(char, name, MAXPATHLEN); + for (i = 0; i < aioinfo->l1; i++) { + snprintf(name, MAXPATHLEN, "%s/%02X", sd->path, i); + if (storeAufsDirCreateDirectory(name, 0)) + should_exist = 0; + else + should_exist = 1; + debug(47, 1) ("Making directories in %s\n", name); + for (k = 0; k < aioinfo->l2; k++) { + snprintf(name, MAXPATHLEN, "%s/%02X/%02X", sd->path, i, k); + storeAufsDirCreateDirectory(name, should_exist); + } + } +} + +static char * +storeAufsDirSwapLogFile(SwapDir * sd, const char *ext) +{ + LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, digit, 32); + char *pathtmp2; + if (Config.Log.swap) { + xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64); + pathtmp2 = pathtmp; + while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL) + *pathtmp2 = '.'; + while (strlen(pathtmp) && pathtmp[strlen(pathtmp) - 1] == '.') + pathtmp[strlen(pathtmp) - 1] = '\0'; + for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++); + snprintf(path, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2); + if (strncmp(path, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) { + strcat(path, "."); + snprintf(digit, 32, "%02d", sd->index); + strncat(path, digit, 3); + } + } else { + xstrncpy(path, sd->path, SQUID_MAXPATHLEN - 64); + strcat(path, "/swap.state"); + } + if (ext) + strncat(path, ext, 16); + return path; +} + +static void +storeAufsDirOpenSwapLog(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + char *path; + int fd; + path = storeAufsDirSwapLogFile(sd, NULL); + if (aioinfo->swaplog_fd >= 0) { + debug(50, 1) ("storeAufsDirOpenSwapLog: %s already open\n", path); + return; + } + fd = file_open(path, O_WRONLY | O_CREAT | O_BINARY); + if (fd < 0) { + debug(50, 1) ("%s: %s\n", path, xstrerror()); + fatal("storeAufsDirOpenSwapLog: Failed to open swap log."); + } + debug(50, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); + aioinfo->swaplog_fd = fd; +} + +static void +storeAufsDirCloseSwapLog(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + if (aioinfo->swaplog_fd < 0) /* not open */ + return; + file_close(aioinfo->swaplog_fd); + debug(47, 3) ("Cache Dir #%d log closed on FD %d\n", + sd->index, aioinfo->swaplog_fd); + aioinfo->swaplog_fd = -1; +} + +static void +storeAufsDirInit(SwapDir * sd) +{ + static int started_clean_event = 0; + static const char *errmsg = + "\tFailed to verify one of the swap directories, Check cache.log\n" + "\tfor details. Run 'squid -z' to create swap directories\n" + "\tif needed, or if running Squid for the first time."; + storeAufsDirInitBitmap(sd); + if (storeAufsDirVerifyCacheDirs(sd) < 0) + fatal(errmsg); + squidaio_init(); + storeAufsDirOpenSwapLog(sd); + storeAufsDirRebuild(sd); + if (!started_clean_event) { + eventAdd("storeDirClean", storeAufsDirCleanEvent, NULL, 15.0, 1); + started_clean_event = 1; + } + (void) storeDirGetBlkSize(sd->path, &sd->fs.blksize); +} + +static void +storeAufsDirRebuildComplete(RebuildState * rb) +{ + if (rb->log) { + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", + rb->sd->path, rb->n_read); + fclose(rb->log); + rb->log = NULL; + } else { + debug(47, 1) ("Done scanning %s (%d entries)\n", + rb->sd->path, rb->counts.scancount); + } + store_dirs_rebuilding--; + storeAufsDirCloseTmpSwapLog(rb->sd); + storeRebuildComplete(&rb->counts); + cbdataFree(rb); +} + +static void +storeAufsDirRebuildFromDirectory(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + LOCAL_ARRAY(char, hdr_buf, SM_PAGE_SIZE); + StoreEntry *e = NULL; + StoreEntry tmpe; + cache_key key[MD5_DIGEST_CHARS]; + sfileno filn = 0; + int count; + int size; + struct stat sb; + int swap_hdr_len; + int fd = -1; + tlv *tlv_list; + tlv *t; + assert(rb != NULL); + debug(47, 3) ("storeAufsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index); + for (count = 0; count < rb->speed; count++) { + assert(fd == -1); + fd = storeAufsDirGetNextFile(rb, &filn, &size); + if (fd == -2) { + storeAufsDirRebuildComplete(rb); + return; + } else if (fd < 0) { + continue; + } + assert(fd > -1); + /* lets get file stats here */ + if (fstat(fd, &sb) < 0) { + debug(47, 1) ("storeAufsDirRebuildFromDirectory: fstat(FD %d): %s\n", + fd, xstrerror()); + file_close(fd); + store_open_disk_fd--; + fd = -1; + continue; + } + if ((++rb->counts.scancount & 0xFFFF) == 0) + debug(47, 3) (" %s %7d files opened so far.\n", + rb->sd->path, rb->counts.scancount); + debug(47, 9) ("file_in: fd=%d %08X\n", fd, filn); + statCounter.syscalls.disk.reads++; + if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) { + debug(47, 1) ("storeAufsDirRebuildFromDirectory: read(FD %d): %s\n", + fd, xstrerror()); + file_close(fd); + store_open_disk_fd--; + fd = -1; + continue; + } + file_close(fd); + store_open_disk_fd--; + fd = -1; + swap_hdr_len = 0; +#if USE_TRUNCATE + if (sb.st_size == 0) + continue; +#endif + tlv_list = storeSwapMetaUnpack(hdr_buf, &swap_hdr_len); + if (tlv_list == NULL) { + debug(47, 1) ("storeAufsDirRebuildFromDirectory: failed to get meta data\n"); + /* XXX shouldn't this be a call to storeAufsUnlink ? */ + storeAufsDirUnlinkFile(SD, filn); + continue; + } + debug(47, 3) ("storeAufsDirRebuildFromDirectory: successful swap meta unpacking\n"); + memset(key, '\0', MD5_DIGEST_CHARS); + memset(&tmpe, '\0', sizeof(StoreEntry)); + for (t = tlv_list; t; t = t->next) { + switch (t->type) { + case STORE_META_KEY: + assert(t->length == MD5_DIGEST_CHARS); + xmemcpy(key, t->value, MD5_DIGEST_CHARS); + break; +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T + case STORE_META_STD: + assert(t->length == STORE_HDR_METASIZE); + xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); + break; +#else + case STORE_META_STD_LFS: + assert(t->length == STORE_HDR_METASIZE); + xmemcpy(&tmpe.timestamp, t->value, STORE_HDR_METASIZE); + break; + case STORE_META_STD: + assert(t->length == STORE_HDR_METASIZE_OLD); + { + struct { + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; + size_t swap_file_sz; + u_short refcount; + u_short flags; + } *tmp = t->value; + assert(sizeof(*tmp) == STORE_HDR_METASIZE_OLD); + tmpe.timestamp = tmp->timestamp; + tmpe.lastref = tmp->lastref; + tmpe.expires = tmp->expires; + tmpe.lastmod = tmp->lastmod; + tmpe.swap_file_sz = tmp->swap_file_sz; + tmpe.refcount = tmp->refcount; + tmpe.flags = tmp->flags; + } + break; +#endif + default: + break; + } + } + storeSwapTLVFree(tlv_list); + tlv_list = NULL; + if (storeKeyNull(key)) { + debug(47, 1) ("storeAufsDirRebuildFromDirectory: NULL key\n"); + storeAufsDirUnlinkFile(SD, filn); + continue; + } + tmpe.hash.key = key; + /* check sizes */ + if (tmpe.swap_file_sz == 0) { + tmpe.swap_file_sz = sb.st_size; + } else if (tmpe.swap_file_sz == sb.st_size - swap_hdr_len) { + tmpe.swap_file_sz = sb.st_size; + } else if (tmpe.swap_file_sz != sb.st_size) { + debug(47, 1) ("storeAufsDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n", + (long int) tmpe.swap_file_sz, (long int) sb.st_size); + storeAufsDirUnlinkFile(SD, filn); + continue; + } + if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) { + storeAufsDirUnlinkFile(SD, filn); + rb->counts.badflags++; + continue; + } + e = storeGet(key); + if (e && e->lastref >= tmpe.lastref) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; + continue; + } else if (NULL != e) { + /* URL already exists, this swapfile not being used */ + /* junk old, load new */ + storeRelease(e); /* release old entry */ + rb->counts.dupcount++; + } + rb->counts.objcount++; + storeEntryDump(&tmpe, 5); + e = storeAufsDirAddDiskRestore(SD, key, + filn, + tmpe.swap_file_sz, + tmpe.expires, + tmpe.timestamp, + tmpe.lastref, + tmpe.lastmod, + tmpe.refcount, /* refcount */ + tmpe.flags, /* flags */ + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeAufsDirRebuildFromDirectory, rb, 0.0, 1); +} + +static void +storeAufsDirRebuildFromSwapLog(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + StoreEntry *e = NULL; + storeSwapLogData s; + size_t ss = sizeof(storeSwapLogData); + int count; + int used; /* is swapfile already in use? */ + int disk_entry_newer; /* is the log entry newer than current entry? */ + double x; + assert(rb != NULL); + /* load a number of objects per invocation */ + for (count = 0; count < rb->speed; count++) { + if (fread(&s, ss, 1, rb->log) != 1) { + storeAufsDirRebuildComplete(rb); + return; + } + rb->n_read++; + /* + * BC: during 2.4 development, we changed the way swap file + * numbers are assigned and stored. The high 16 bits used + * to encode the SD index number. There used to be a call + * to storeDirProperFileno here that re-assigned the index + * bits. Now, for backwards compatibility, we just need + * to mask it off. + */ + s.swap_filen &= 0x00FFFFFF; + debug(47, 3) ("storeAufsDirRebuildFromSwapLog: %s %s %08X\n", + swap_log_op_str[(int) s.op], + storeKeyText(s.key), + s.swap_filen); + if (s.op == SWAP_LOG_ADD) { + (void) 0; + } else if (s.op == SWAP_LOG_DEL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { + /* + * Make sure we don't unlink the file, it might be + * in use by a subsequent entry. Also note that + * we don't have to subtract from store_swap_size + * because adding to store_swap_size happens in + * the cleanup procedure. + */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.objcount--; + rb->counts.cancelcount++; + } + continue; + } else { + x = log(++rb->counts.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", + rb->counts.bad_log_op); + rb->counts.invalid++; + continue; + } + if ((++rb->counts.scancount & 0xFFF) == 0) { + struct stat sb; + if (0 == fstat(fileno(rb->log), &sb)) + storeRebuildProgress(SD->index, + (int) sb.st_size / ss, rb->n_read); + } + if (!storeAufsDirValidFileno(SD, s.swap_filen, 0)) { + rb->counts.invalid++; + continue; + } + if (EBIT_TEST(s.flags, KEY_PRIVATE)) { + rb->counts.badflags++; + continue; + } + e = storeGet(s.key); + used = storeAufsDirMapBitTest(SD, s.swap_filen); + /* If this URL already exists in the cache, does the swap log + * appear to have a newer entry? Compare 'lastref' from the + * swap log to e->lastref. */ + disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; + if (used && !disk_entry_newer) { + /* log entry is old, ignore it */ + rb->counts.clashcount++; + continue; + } else if (used && e && e->swap_filen == s.swap_filen && e->swap_dirn == SD->index) { + /* swapfile taken, same URL, newer, update meta */ + if (e->store_status == STORE_OK) { + e->lastref = s.timestamp; + e->timestamp = s.timestamp; + e->expires = s.expires; + e->lastmod = s.lastmod; + e->flags = s.flags; + e->refcount += s.refcount; + storeAufsDirUnrefObj(SD, e); + } else { + debug_trap("storeAufsDirRebuildFromSwapLog: bad condition"); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + } + continue; + } else if (used) { + /* swapfile in use, not by this URL, log entry is newer */ + /* This is sorta bad: the log entry should NOT be newer at this + * point. If the log is dirty, the filesize check should have + * caught this. If the log is clean, there should never be a + * newer entry. */ + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + SD->index, s.swap_filen); + /* I'm tempted to remove the swapfile here just to be safe, + * but there is a bad race condition in the NOVM version if + * the swapfile has recently been opened for writing, but + * not yet opened for reading. Because we can't map + * swapfiles back to StoreEntrys, we don't know the state + * of the entry using that file. */ + /* We'll assume the existing entry is valid, probably because + * were in a slow rebuild and the the swap file number got taken + * and the validation procedure hasn't run. */ + assert(rb->flags.need_to_validate); + rb->counts.clashcount++; + continue; + } else if (e && !disk_entry_newer) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; + continue; + } else if (e) { + /* key already exists, this swapfile not being used */ + /* junk old, load new */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + /* Make sure we don't actually unlink the file */ + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.dupcount++; + } else { + /* URL doesnt exist, swapfile not in use */ + /* load new */ + (void) 0; + } + /* update store_swap_size */ + rb->counts.objcount++; + e = storeAufsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); +} + +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T +/* This is an exact copy of the above, but using storeSwapLogDataOld entry type */ +static void +storeAufsDirRebuildFromSwapLogOld(void *data) +{ + RebuildState *rb = data; + SwapDir *SD = rb->sd; + StoreEntry *e = NULL; + storeSwapLogDataOld s; + size_t ss = sizeof(storeSwapLogDataOld); + int count; + int used; /* is swapfile already in use? */ + int disk_entry_newer; /* is the log entry newer than current entry? */ + double x; + assert(rb != NULL); + /* load a number of objects per invocation */ + for (count = 0; count < rb->speed; count++) { + if (fread(&s, ss, 1, rb->log) != 1) { + storeAufsDirRebuildComplete(rb); + return; + } + rb->n_read++; + /* + * BC: during 2.4 development, we changed the way swap file + * numbers are assigned and stored. The high 16 bits used + * to encode the SD index number. There used to be a call + * to storeDirProperFileno here that re-assigned the index + * bits. Now, for backwards compatibility, we just need + * to mask it off. + */ + s.swap_filen &= 0x00FFFFFF; + debug(47, 3) ("storeAufsDirRebuildFromSwapLog: %s %s %08X\n", + swap_log_op_str[(int) s.op], + storeKeyText(s.key), + s.swap_filen); + if (s.op == SWAP_LOG_ADD) { + (void) 0; + } else if (s.op == SWAP_LOG_DEL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { + /* + * Make sure we don't unlink the file, it might be + * in use by a subsequent entry. Also note that + * we don't have to subtract from store_swap_size + * because adding to store_swap_size happens in + * the cleanup procedure. + */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.objcount--; + rb->counts.cancelcount++; + } + continue; + } else { + x = log(++rb->counts.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", + rb->counts.bad_log_op); + rb->counts.invalid++; + continue; + } + if ((++rb->counts.scancount & 0xFFF) == 0) { + struct stat sb; + if (0 == fstat(fileno(rb->log), &sb)) + storeRebuildProgress(SD->index, + (int) sb.st_size / ss, rb->n_read); + } + if (!storeAufsDirValidFileno(SD, s.swap_filen, 0)) { + rb->counts.invalid++; + continue; + } + if (EBIT_TEST(s.flags, KEY_PRIVATE)) { + rb->counts.badflags++; + continue; + } + e = storeGet(s.key); + used = storeAufsDirMapBitTest(SD, s.swap_filen); + /* If this URL already exists in the cache, does the swap log + * appear to have a newer entry? Compare 'lastref' from the + * swap log to e->lastref. */ + disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; + if (used && !disk_entry_newer) { + /* log entry is old, ignore it */ + rb->counts.clashcount++; + continue; + } else if (used && e && e->swap_filen == s.swap_filen && e->swap_dirn == SD->index) { + /* swapfile taken, same URL, newer, update meta */ + if (e->store_status == STORE_OK) { + e->lastref = s.timestamp; + e->timestamp = s.timestamp; + e->expires = s.expires; + e->lastmod = s.lastmod; + e->flags = s.flags; + e->refcount += s.refcount; + storeAufsDirUnrefObj(SD, e); + } else { + debug_trap("storeAufsDirRebuildFromSwapLog: bad condition"); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + } + continue; + } else if (used) { + /* swapfile in use, not by this URL, log entry is newer */ + /* This is sorta bad: the log entry should NOT be newer at this + * point. If the log is dirty, the filesize check should have + * caught this. If the log is clean, there should never be a + * newer entry. */ + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + SD->index, s.swap_filen); + /* I'm tempted to remove the swapfile here just to be safe, + * but there is a bad race condition in the NOVM version if + * the swapfile has recently been opened for writing, but + * not yet opened for reading. Because we can't map + * swapfiles back to StoreEntrys, we don't know the state + * of the entry using that file. */ + /* We'll assume the existing entry is valid, probably because + * were in a slow rebuild and the the swap file number got taken + * and the validation procedure hasn't run. */ + assert(rb->flags.need_to_validate); + rb->counts.clashcount++; + continue; + } else if (e && !disk_entry_newer) { + /* key already exists, current entry is newer */ + /* keep old, ignore new */ + rb->counts.dupcount++; + continue; + } else if (e) { + /* key already exists, this swapfile not being used */ + /* junk old, load new */ + storeExpireNow(e); + storeReleaseRequest(e); + if (e->swap_filen > -1) { + storeAufsDirReplRemove(e); + /* Make sure we don't actually unlink the file */ + storeAufsDirMapBitReset(SD, e->swap_filen); + e->swap_filen = -1; + e->swap_dirn = -1; + } + storeRelease(e); + rb->counts.dupcount++; + } else { + /* URL doesnt exist, swapfile not in use */ + /* load new */ + (void) 0; + } + /* update store_swap_size */ + rb->counts.objcount++; + e = storeAufsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); + } + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); +} + +#endif + +static void +storeAufsDirRebuildFromSwapLogCheckVersion(void *data) +{ + RebuildState *rb = data; + storeSwapLogHeader hdr; + + if (fread(&hdr, sizeof(hdr), 1, rb->log) != 1) { + storeAufsDirRebuildComplete(rb); + return; + } + if (hdr.op == SWAP_LOG_VERSION) { + if (fseek(rb->log, hdr.record_size, SEEK_SET) != 0) { + storeAufsDirRebuildComplete(rb); + return; + } + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogData)) { + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); + return; + } +#if SIZEOF_SQUID_FILE_SZ != SIZEOF_SIZE_T + if (hdr.version == 1 && hdr.record_size == sizeof(storeSwapLogDataOld)) { + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Found current version but without large file support. Upgrading\n"); + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); + return; + } +#endif + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Unsupported swap.state version %d size %d\n", + hdr.version, hdr.record_size); + storeAufsDirRebuildComplete(rb); + return; + } + rewind(rb->log); + debug(47, 1) ("storeAufsDirRebuildFromSwapLog: Old version detected. Upgrading\n"); +#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLog, rb, 0.0, 1); +#else + eventAdd("storeRebuild", storeAufsDirRebuildFromSwapLogOld, rb, 0.0, 1); +#endif +} + +static int +storeAufsDirGetNextFile(RebuildState * rb, sfileno * filn_p, int *size) +{ + SwapDir *SD = rb->sd; + squidaioinfo_t *aioinfo = (squidaioinfo_t *) SD->fsdata; + int fd = -1; + int used = 0; + int dirs_opened = 0; + debug(47, 3) ("storeAufsDirGetNextFile: flag=%d, %d: /%02X/%02X\n", + rb->flags.init, + rb->sd->index, + rb->curlvl1, + rb->curlvl2); + if (rb->done) + return -2; + while (fd < 0 && rb->done == 0) { + fd = -1; + if (0 == rb->flags.init) { /* initialize, open first file */ + rb->done = 0; + rb->curlvl1 = 0; + rb->curlvl2 = 0; + rb->in_dir = 0; + rb->flags.init = 1; + assert(Config.cacheSwap.n_configured > 0); + } + if (0 == rb->in_dir) { /* we need to read in a new directory */ + snprintf(rb->fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X", + rb->sd->path, + rb->curlvl1, rb->curlvl2); + if (dirs_opened) + return -1; + rb->td = opendir(rb->fullpath); + dirs_opened++; + if (rb->td == NULL) { + debug(47, 1) ("storeAufsDirGetNextFile: opendir: %s: %s\n", + rb->fullpath, xstrerror()); + } else { + rb->entry = readdir(rb->td); /* skip . and .. */ + rb->entry = readdir(rb->td); + if (rb->entry == NULL && errno == ENOENT) + debug(47, 1) ("storeAufsDirGetNextFile: directory does not exist!.\n"); + debug(47, 3) ("storeAufsDirGetNextFile: Directory %s\n", rb->fullpath); + } + } + if (rb->td != NULL && (rb->entry = readdir(rb->td)) != NULL) { + rb->in_dir++; + if (sscanf(rb->entry->d_name, "%x", &rb->fn) != 1) { + debug(47, 3) ("storeAufsDirGetNextFile: invalid %s\n", + rb->entry->d_name); + continue; + } + if (!storeAufsFilenoBelongsHere(rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2)) { + debug(47, 3) ("storeAufsDirGetNextFile: %08X does not belong in %d/%d/%d\n", + rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2); + continue; + } + used = storeAufsDirMapBitTest(SD, rb->fn); + if (used) { + debug(47, 3) ("storeAufsDirGetNextFile: Locked, continuing with next.\n"); + continue; + } + snprintf(rb->fullfilename, SQUID_MAXPATHLEN, "%s/%s", + rb->fullpath, rb->entry->d_name); + debug(47, 3) ("storeAufsDirGetNextFile: Opening %s\n", rb->fullfilename); + fd = file_open(rb->fullfilename, O_RDONLY | O_BINARY); + if (fd < 0) + debug(47, 1) ("storeAufsDirGetNextFile: %s: %s\n", rb->fullfilename, xstrerror()); + else + store_open_disk_fd++; + continue; + } + if (rb->td != NULL) + closedir(rb->td); + rb->td = NULL; + rb->in_dir = 0; + if (++rb->curlvl2 < aioinfo->l2) + continue; + rb->curlvl2 = 0; + if (++rb->curlvl1 < aioinfo->l1) + continue; + rb->curlvl1 = 0; + rb->done = 1; + } + *filn_p = rb->fn; + return fd; +} + +/* Add a new object to the cache with empty memory copy and pointer to disk + * use to rebuild store from disk. */ +static StoreEntry * +storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, + sfileno file_number, + squid_file_sz swap_file_sz, + time_t expires, + time_t timestamp, + time_t lastref, + time_t lastmod, + u_num32 refcount, + u_short flags, + int clean) +{ + StoreEntry *e = NULL; + debug(47, 5) ("storeAufsAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); + /* if you call this you'd better be sure file_number is not + * already in use! */ + e = new_StoreEntry(STORE_ENTRY_WITHOUT_MEMOBJ, NULL, NULL); + e->store_status = STORE_OK; + storeSetMemStatus(e, NOT_IN_MEMORY); + e->swap_status = SWAPOUT_DONE; + e->swap_filen = file_number; + e->swap_dirn = SD->index; + e->swap_file_sz = swap_file_sz; + e->lock_count = 0; + e->lastref = lastref; + e->timestamp = timestamp; + e->expires = expires; + e->lastmod = lastmod; + e->refcount = refcount; + e->flags = flags; + EBIT_SET(e->flags, ENTRY_CACHABLE); + EBIT_CLR(e->flags, RELEASE_REQUEST); + EBIT_CLR(e->flags, KEY_PRIVATE); + e->ping_status = PING_NONE; + EBIT_CLR(e->flags, ENTRY_VALIDATED); + storeAufsDirMapBitSet(SD, e->swap_filen); + storeHashInsert(e, key); /* do it after we clear KEY_PRIVATE */ + storeAufsDirReplAdd(SD, e); + return e; +} + +CBDATA_TYPE(RebuildState); + +static void +storeAufsDirRebuild(SwapDir * sd) +{ + RebuildState *rb; + int clean = 0; + int zero = 0; + FILE *fp; + EVH *func = NULL; + CBDATA_INIT_TYPE(RebuildState); + rb = cbdataAlloc(RebuildState); + rb->sd = sd; + rb->speed = opt_foreground_rebuild ? 1 << 30 : 50; + /* + * If the swap.state file exists in the cache_dir, then + * we'll use storeAufsDirRebuildFromSwapLog(), otherwise we'll + * use storeAufsDirRebuildFromDirectory() to open up each file + * and suck in the meta data. + */ + fp = storeAufsDirOpenTmpSwapLog(sd, &clean, &zero); + if (fp == NULL || zero) { + if (fp != NULL) + fclose(fp); + func = storeAufsDirRebuildFromDirectory; + } else { + func = storeAufsDirRebuildFromSwapLogCheckVersion; + rb->log = fp; + rb->flags.clean = (unsigned int) clean; + } + if (!clean) + rb->flags.need_to_validate = 1; + debug(47, 1) ("Rebuilding storage in %s (%s)\n", + sd->path, clean ? "CLEAN" : "DIRTY"); + store_dirs_rebuilding++; + eventAdd("storeRebuild", func, rb, 0.0, 1); +} + +static void +storeAufsDirCloseTmpSwapLog(SwapDir * sd) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + char *swaplog_path = xstrdup(storeAufsDirSwapLogFile(sd, NULL)); + char *new_path = xstrdup(storeAufsDirSwapLogFile(sd, ".new")); + int fd; + file_close(aioinfo->swaplog_fd); + if (xrename(new_path, swaplog_path) < 0) { + fatal("storeAufsDirCloseTmpSwapLog: rename failed"); + } + fd = file_open(swaplog_path, O_WRONLY | O_CREAT | O_BINARY); + if (fd < 0) { + debug(50, 1) ("%s: %s\n", swaplog_path, xstrerror()); + fatal("storeAufsDirCloseTmpSwapLog: Failed to open swap log."); + } + safe_free(swaplog_path); + safe_free(new_path); + aioinfo->swaplog_fd = fd; + debug(47, 3) ("Cache Dir #%d log opened on FD %d\n", sd->index, fd); +} + +static void +storeSwapLogDataFree(void *s) +{ + memFree(s, MEM_SWAP_LOG_DATA); +} + +static void +storeAufsWriteSwapLogheader(int fd) +{ + storeSwapLogHeader *hdr = memAllocate(MEM_SWAP_LOG_DATA); + hdr->op = SWAP_LOG_VERSION; + hdr->version = 1; + hdr->record_size = sizeof(storeSwapLogData); + /* The header size is a full log record to keep some level of backward + * compatibility even if the actual header is smaller + */ + file_write(fd, + -1, + hdr, + sizeof(storeSwapLogData), + NULL, + NULL, + (FREE *) storeSwapLogDataFree); +} + +static FILE * +storeAufsDirOpenTmpSwapLog(SwapDir * sd, int *clean_flag, int *zero_flag) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + char *swaplog_path = xstrdup(storeAufsDirSwapLogFile(sd, NULL)); + char *clean_path = xstrdup(storeAufsDirSwapLogFile(sd, ".last-clean")); + char *new_path = xstrdup(storeAufsDirSwapLogFile(sd, ".new")); + struct stat log_sb; + struct stat clean_sb; + FILE *fp; + int fd; + if (stat(swaplog_path, &log_sb) < 0) { + debug(47, 1) ("Cache Dir #%d: No log file\n", sd->index); + safe_free(swaplog_path); + safe_free(clean_path); + safe_free(new_path); + return NULL; + } + *zero_flag = log_sb.st_size == 0 ? 1 : 0; + /* close the existing write-only FD */ + if (aioinfo->swaplog_fd >= 0) + file_close(aioinfo->swaplog_fd); + /* open a write-only FD for the new log */ + fd = file_open(new_path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY); + if (fd < 0) { + debug(50, 1) ("%s: %s\n", new_path, xstrerror()); + fatal("storeDirOpenTmpSwapLog: Failed to open swap log."); + } + aioinfo->swaplog_fd = fd; + storeAufsWriteSwapLogheader(fd); + /* open a read-only stream of the old log */ + fp = fopen(swaplog_path, "rb"); + if (fp == NULL) { + debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); + fatal("Failed to open swap log for reading"); + } + memset(&clean_sb, '\0', sizeof(struct stat)); + if (stat(clean_path, &clean_sb) < 0) + *clean_flag = 0; + else if (clean_sb.st_mtime < log_sb.st_mtime) + *clean_flag = 0; + else + *clean_flag = 1; + safeunlink(clean_path, 1); + safe_free(swaplog_path); + safe_free(clean_path); + safe_free(new_path); + return fp; +} + +struct _clean_state { + char *cur; + char *new; + char *cln; + char *outbuf; + int outbuf_offset; + int fd; + RemovalPolicyWalker *walker; +}; + +#define CLEAN_BUF_SZ 16384 +/* + * Begin the process to write clean cache state. For AUFS this means + * opening some log files and allocating write buffers. Return 0 if + * we succeed, and assign the 'func' and 'data' return pointers. + */ +static int +storeAufsDirWriteCleanStart(SwapDir * sd) +{ + struct _clean_state *state = xcalloc(1, sizeof(*state)); +#if HAVE_FCHMOD + struct stat sb; +#endif + sd->log.clean.write = NULL; + sd->log.clean.state = NULL; + state->new = xstrdup(storeAufsDirSwapLogFile(sd, ".clean")); + state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY); + if (state->fd < 0) { + debug(50, 0) ("storeDirWriteCleanStart: %s: open: %s\n", + state->new, xstrerror()); + debug(50, 0) ("storeDirWriteCleanStart: Current swap logfile " + "not replaced.\n"); + xfree(state->new); + xfree(state); + return -1; + } + storeAufsWriteSwapLogheader(state->fd); + state->cur = xstrdup(storeAufsDirSwapLogFile(sd, NULL)); + state->cln = xstrdup(storeAufsDirSwapLogFile(sd, ".last-clean")); + state->outbuf = xcalloc(CLEAN_BUF_SZ, 1); + state->outbuf_offset = 0; + state->walker = sd->repl->WalkInit(sd->repl); + unlink(state->cln); + debug(47, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", + state->new, state->fd); +#if HAVE_FCHMOD + if (stat(state->cur, &sb) == 0) + fchmod(state->fd, sb.st_mode); +#endif + sd->log.clean.write = storeAufsDirWriteCleanEntry; + sd->log.clean.state = state; + return 0; +} + +/* + * Get the next entry that is a candidate for clean log writing + */ +const StoreEntry * +storeAufsDirCleanLogNextEntry(SwapDir * sd) +{ + const StoreEntry *entry = NULL; + struct _clean_state *state = sd->log.clean.state; + if (state->walker) + entry = state->walker->Next(state->walker); + return entry; +} + +/* + * "write" an entry to the clean log file. + */ +static void +storeAufsDirWriteCleanEntry(SwapDir * sd, const StoreEntry * e) +{ + storeSwapLogData s; + static size_t ss = sizeof(storeSwapLogData); + struct _clean_state *state = sd->log.clean.state; + memset(&s, '\0', ss); + s.op = (char) SWAP_LOG_ADD; + s.swap_filen = e->swap_filen; + s.timestamp = e->timestamp; + s.lastref = e->lastref; + s.expires = e->expires; + s.lastmod = e->lastmod; + s.swap_file_sz = e->swap_file_sz; + s.refcount = e->refcount; + s.flags = e->flags; + xmemcpy(&s.key, e->hash.key, MD5_DIGEST_CHARS); + xmemcpy(state->outbuf + state->outbuf_offset, &s, ss); + state->outbuf_offset += ss; + /* buffered write */ + if (state->outbuf_offset + ss > CLEAN_BUF_SZ) { + if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { + debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", + state->new, xstrerror()); + debug(50, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n"); + file_close(state->fd); + state->fd = -1; + unlink(state->new); + safe_free(state); + sd->log.clean.state = NULL; + sd->log.clean.write = NULL; + return; + } + state->outbuf_offset = 0; + } +} + +static void +storeAufsDirWriteCleanDone(SwapDir * sd) +{ + int fd; + struct _clean_state *state = sd->log.clean.state; + if (NULL == state) + return; + if (state->fd < 0) + return; + state->walker->Done(state->walker); + if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { + debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", + state->new, xstrerror()); + debug(50, 0) ("storeDirWriteCleanLogs: Current swap logfile " + "not replaced.\n"); + file_close(state->fd); + state->fd = -1; + unlink(state->new); + } + safe_free(state->outbuf); + /* + * You can't rename open files on Microsoft "operating systems" + * so we have to close before renaming. + */ + storeAufsDirCloseSwapLog(sd); + /* save the fd value for a later test */ + fd = state->fd; + /* rename */ + if (state->fd >= 0) { +#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) + file_close(state->fd); + state->fd = -1; +#endif + xrename(state->new, state->cur); + } + /* touch a timestamp file if we're not still validating */ + if (store_dirs_rebuilding) + (void) 0; + else if (fd < 0) + (void) 0; + else + file_close(file_open(state->cln, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY)); + /* close */ + safe_free(state->cur); + safe_free(state->new); + safe_free(state->cln); + if (state->fd >= 0) + file_close(state->fd); + state->fd = -1; + safe_free(state); + sd->log.clean.state = NULL; + sd->log.clean.write = NULL; +} + +static void +storeAufsDirSwapLog(const SwapDir * sd, const StoreEntry * e, int op) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) sd->fsdata; + storeSwapLogData *s = memAllocate(MEM_SWAP_LOG_DATA); + s->op = (char) op; + s->swap_filen = e->swap_filen; + s->timestamp = e->timestamp; + s->lastref = e->lastref; + s->expires = e->expires; + s->lastmod = e->lastmod; + s->swap_file_sz = e->swap_file_sz; + s->refcount = e->refcount; + s->flags = e->flags; + xmemcpy(s->key, e->hash.key, MD5_DIGEST_CHARS); + file_write(aioinfo->swaplog_fd, + -1, + s, + sizeof(storeSwapLogData), + NULL, + NULL, + (FREE *) storeSwapLogDataFree); +} + +static void +storeAufsDirNewfs(SwapDir * sd) +{ + debug(47, 3) ("Creating swap space in %s\n", sd->path); + storeAufsDirCreateDirectory(sd->path, 0); + storeAufsDirCreateSwapSubDirs(sd); +} + +static int +rev_int_sort(const void *A, const void *B) +{ + const int *i1 = A; + const int *i2 = B; + return *i2 - *i1; +} + +static int +storeAufsDirClean(int swap_index) +{ + DIR *dp = NULL; + struct dirent *de = NULL; + LOCAL_ARRAY(char, p1, MAXPATHLEN + 1); + LOCAL_ARRAY(char, p2, MAXPATHLEN + 1); +#if USE_TRUNCATE + struct stat sb; +#endif + int files[20]; + int swapfileno; + int fn; /* same as swapfileno, but with dirn bits set */ + int n = 0; + int k = 0; + int N0, N1, N2; + int D0, D1, D2; + SwapDir *SD; + squidaioinfo_t *aioinfo; + N0 = n_asyncufs_dirs; + D0 = asyncufs_dir_index[swap_index % N0]; + SD = &Config.cacheSwap.swapDirs[D0]; + aioinfo = (squidaioinfo_t *) SD->fsdata; + N1 = aioinfo->l1; + D1 = (swap_index / N0) % N1; + N2 = aioinfo->l2; + D2 = ((swap_index / N0) / N1) % N2; + snprintf(p1, SQUID_MAXPATHLEN, "%s/%02X/%02X", + Config.cacheSwap.swapDirs[D0].path, D1, D2); + debug(36, 3) ("storeDirClean: Cleaning directory %s\n", p1); + dp = opendir(p1); + if (dp == NULL) { + if (errno == ENOENT) { + debug(36, 0) ("storeDirClean: WARNING: Creating %s\n", p1); +#ifdef _SQUID_MSWIN_ + if (mkdir(p1) == 0) +#else + if (mkdir(p1, 0777) == 0) +#endif + return 0; + } + debug(50, 0) ("storeDirClean: %s: %s\n", p1, xstrerror()); + safeunlink(p1, 1); + return 0; + } + while ((de = readdir(dp)) != NULL && k < 20) { + if (sscanf(de->d_name, "%X", &swapfileno) != 1) + continue; + fn = swapfileno; /* XXX should remove this cruft ! */ + if (storeAufsDirValidFileno(SD, fn, 1)) + if (storeAufsDirMapBitTest(SD, fn)) + if (storeAufsFilenoBelongsHere(fn, D0, D1, D2)) + continue; +#if USE_TRUNCATE + if (!stat(de->d_name, &sb)) + if (sb.st_size == 0) + continue; +#endif + files[k++] = swapfileno; + } + closedir(dp); + if (k == 0) + return 0; + qsort(files, k, sizeof(int), rev_int_sort); + if (k > 10) + k = 10; + for (n = 0; n < k; n++) { + debug(36, 3) ("storeDirClean: Cleaning file %08X\n", files[n]); + snprintf(p2, MAXPATHLEN + 1, "%s/%08X", p1, files[n]); +#if USE_TRUNCATE + truncate(p2, 0); +#else + safeunlink(p2, 0); +#endif + statCounter.swap.files_cleaned++; + } + debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1); + return k; +} + +static void +storeAufsDirCleanEvent(void *unused) +{ + static int swap_index = -1; + int j = 0; + int n = 0; + /* + * Assert that there are AUFS cache_dirs configured, otherwise + * we should never be called. + */ + if (swap_index == -1) { + SwapDir *sd; + squidaioinfo_t *aioinfo; + /* + * Start the storeAufsDirClean() swap_index with a random + * value. j equals the total number of AUFS level 2 + * swap directories + */ + for (n = 0; n < n_asyncufs_dirs; n++) { + sd = &Config.cacheSwap.swapDirs[asyncufs_dir_index[n]]; + aioinfo = (squidaioinfo_t *) sd->fsdata; + j += (aioinfo->l1 * aioinfo->l2); + } + swap_index = (int) (squid_random() % j); + } + if (0 == store_dirs_rebuilding) { + n = storeAufsDirClean(swap_index); + swap_index++; + if (swap_index < 0) + swap_index = 0; + } + eventAdd("storeDirClean", storeAufsDirCleanEvent, NULL, + 15.0 * exp(-0.25 * n), 1); +} + +/* + * Does swapfile number 'fn' belong in cachedir #F0, + * level1 dir #F1, level2 dir #F2? + */ +static int +storeAufsFilenoBelongsHere(int fn, int F0, int F1, int F2) +{ + int D1, D2; + int L1, L2; + int filn = fn; + squidaioinfo_t *aioinfo; + assert(F0 < Config.cacheSwap.n_configured); + aioinfo = (squidaioinfo_t *) Config.cacheSwap.swapDirs[F0].fsdata; + L1 = aioinfo->l1; + L2 = aioinfo->l2; + D1 = ((filn / L2) / L2) % L1; + if (F1 != D1) + return 0; + D2 = (filn / L2) % L2; + if (F2 != D2) + return 0; + return 1; +} + +int +storeAufsDirValidFileno(SwapDir * SD, sfileno filn, int flag) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) SD->fsdata; + if (filn < 0) + return 0; + /* + * If flag is set it means out-of-range file number should + * be considered invalid. + */ + if (flag) + if (filn > aioinfo->map->max_n_files) + return 0; + return 1; +} + +void +storeAufsDirMaintain(SwapDir * SD) +{ + StoreEntry *e = NULL; + int removed = 0; + int max_scan; + int max_remove; + double f; + RemovalPurgeWalker *walker; + /* We can't delete objects while rebuilding swap */ + if (store_dirs_rebuilding) { + return; + } else { + f = (double) (SD->cur_size - SD->low_size) / (SD->max_size - SD->low_size); + f = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f; + max_scan = (int) (f * 400.0 + 100.0); + max_remove = (int) (f * 70.0 + 10.0); + /* + * This is kinda cheap, but so we need this priority hack? + */ + } + debug(47, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", + f, max_scan, max_remove); + walker = SD->repl->PurgeInit(SD->repl, max_scan); + while (1) { + if (SD->cur_size < SD->low_size) + break; + if (removed >= max_remove) + break; + e = walker->Next(walker); + if (!e) + break; /* no more objects */ + removed++; + storeRelease(e); + } + walker->Done(walker); + debug(47, (removed ? 2 : 3)) ("storeAufsDirMaintain: %s removed %d/%d f=%.03f max_scan=%d\n", + SD->path, removed, max_remove, f, max_scan); +} + +/* + * storeAufsDirCheckObj + * + * This routine is called by storeDirSelectSwapDir to see if the given + * object is able to be stored on this filesystem. AUFS filesystems will + * happily store anything as long as the LRU time isn't too small. + */ +int +storeAufsDirCheckObj(SwapDir * SD, const StoreEntry * e) +{ + int loadav; + int ql; + +#if OLD_UNUSED_CODE + if (storeAufsDirExpiredReferenceAge(SD) < 300) { + debug(47, 3) ("storeAufsDirCheckObj: NO: LRU Age = %d\n", + storeAufsDirExpiredReferenceAge(SD)); + /* store_check_cachable_hist.no.lru_age_too_low++; */ + return -1; + } +#endif + ql = aioQueueSize(); + if (ql == 0) + loadav = 0; + loadav = ql * 1000 / MAGIC1; + debug(47, 9) ("storeAufsDirCheckObj: load=%d\n", loadav); + return loadav; +} + +/* + * storeAufsDirRefObj + * + * This routine is called whenever an object is referenced, so we can + * maintain replacement information within the storage fs. + */ +void +storeAufsDirRefObj(SwapDir * SD, StoreEntry * e) +{ + debug(47, 3) ("storeAufsDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, + e->swap_filen); + if (SD->repl->Referenced) + SD->repl->Referenced(SD->repl, e, &e->repl); +} + +/* + * storeAufsDirUnrefObj + * This routine is called whenever the last reference to an object is + * removed, to maintain replacement information within the storage fs. + */ +void +storeAufsDirUnrefObj(SwapDir * SD, StoreEntry * e) +{ + debug(47, 3) ("storeAufsDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, + e->swap_filen); + if (SD->repl->Dereferenced) + SD->repl->Dereferenced(SD->repl, e, &e->repl); +} + +/* + * storeAufsDirUnlinkFile + * + * This routine unlinks a file and pulls it out of the bitmap. + * It used to be in storeAufsUnlink(), however an interface change + * forced this bit of code here. Eeek. + */ +void +storeAufsDirUnlinkFile(SwapDir * SD, sfileno f) +{ + debug(79, 3) ("storeAufsDirUnlinkFile: unlinking fileno %08X\n", f); + /* storeAufsDirMapBitReset(SD, f); */ +#if USE_TRUNCATE_NOT_UNLINK + aioTruncate(storeAufsDirFullPath(SD, f, NULL), NULL, NULL); +#else + aioUnlink(storeAufsDirFullPath(SD, f, NULL), NULL, NULL); +#endif +} + +/* + * Add and remove the given StoreEntry from the replacement policy in + * use. + */ + +void +storeAufsDirReplAdd(SwapDir * SD, StoreEntry * e) +{ + debug(47, 4) ("storeAufsDirReplAdd: added node %p to dir %d\n", e, + SD->index); + SD->repl->Add(SD->repl, e, &e->repl); +} + + +void +storeAufsDirReplRemove(StoreEntry * e) +{ + SwapDir *SD = INDEXSD(e->swap_dirn); + debug(47, 4) ("storeAufsDirReplRemove: remove node %p from dir %d\n", e, + SD->index); + SD->repl->Remove(SD->repl, e, &e->repl); +} + + + +/* ========== LOCAL FUNCTIONS ABOVE, GLOBAL FUNCTIONS BELOW ========== */ + +void +storeAufsDirStats(SwapDir * SD, StoreEntry * sentry) +{ + squidaioinfo_t *aioinfo = SD->fsdata; + int totl_kb = 0; + int free_kb = 0; + int totl_in = 0; + int free_in = 0; + int x; + storeAppendPrintf(sentry, "First level subdirectories: %d\n", aioinfo->l1); + storeAppendPrintf(sentry, "Second level subdirectories: %d\n", aioinfo->l2); + storeAppendPrintf(sentry, "Maximum Size: %d KB\n", SD->max_size); + storeAppendPrintf(sentry, "Current Size: %d KB\n", SD->cur_size); + storeAppendPrintf(sentry, "Percent Used: %0.2f%%\n", + 100.0 * SD->cur_size / SD->max_size); + storeAppendPrintf(sentry, "Filemap bits in use: %d of %d (%d%%)\n", + aioinfo->map->n_files_in_map, aioinfo->map->max_n_files, + percent(aioinfo->map->n_files_in_map, aioinfo->map->max_n_files)); + x = storeDirGetUFSStats(SD->path, &totl_kb, &free_kb, &totl_in, &free_in); + if (0 == x) { + storeAppendPrintf(sentry, "Filesystem Space in use: %d/%d KB (%d%%)\n", + totl_kb - free_kb, + totl_kb, + percent(totl_kb - free_kb, totl_kb)); + storeAppendPrintf(sentry, "Filesystem Inodes in use: %d/%d (%d%%)\n", + totl_in - free_in, + totl_in, + percent(totl_in - free_in, totl_in)); + } + storeAppendPrintf(sentry, "Flags:"); + if (SD->flags.selected) + storeAppendPrintf(sentry, " SELECTED"); + if (SD->flags.read_only) + storeAppendPrintf(sentry, " READ-ONLY"); + storeAppendPrintf(sentry, "\n"); +} + +static struct cache_dir_option options[] = +{ +#if NOT_YET_DONE + {"L1", storeAufsDirParseL1, storeAufsDirDumpL1}, + {"L2", storeAufsDirParseL2, storeAufsDirDumpL2}, +#endif + {NULL, NULL} +}; + +/* + * storeAufsDirReconfigure + * + * This routine is called when the given swapdir needs reconfiguring + */ +static void +storeAufsDirReconfigure(SwapDir * sd, int index, char *path) +{ + int i; + int size; + int l1; + int l2; + + i = GetInteger(); + size = i << 10; /* Mbytes to kbytes */ + if (size <= 0) + fatal("storeAufsDirReconfigure: invalid size value"); + i = GetInteger(); + l1 = i; + if (l1 <= 0) + fatal("storeAufsDirReconfigure: invalid level 1 directories value"); + i = GetInteger(); + l2 = i; + if (l2 <= 0) + fatal("storeAufsDirReconfigure: invalid level 2 directories value"); + + /* just reconfigure it */ + if (size == sd->max_size) + debug(3, 1) ("Cache dir '%s' size remains unchanged at %d KB\n", + path, size); + else + debug(3, 1) ("Cache dir '%s' size changed to %d KB\n", + path, size); + sd->max_size = size; + + parse_cachedir_options(sd, options, 0); + + return; +} + +void +storeAufsDirDump(StoreEntry * entry, SwapDir * s) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) s->fsdata; + storeAppendPrintf(entry, " %d %d %d", + s->max_size >> 10, + aioinfo->l1, + aioinfo->l2); + dump_cachedir_options(entry, options, s); +} + +/* + * Only "free" the filesystem specific stuff here + */ +static void +storeAufsDirFree(SwapDir * s) +{ + squidaioinfo_t *aioinfo = (squidaioinfo_t *) s->fsdata; + if (aioinfo->swaplog_fd > -1) { + file_close(aioinfo->swaplog_fd); + aioinfo->swaplog_fd = -1; + } + filemapFreeMemory(aioinfo->map); + xfree(aioinfo); + s->fsdata = NULL; /* Will aid debugging... */ +} + +char * +storeAufsDirFullPath(SwapDir * SD, sfileno filn, char *fullpath) +{ + LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); + squidaioinfo_t *aioinfo = (squidaioinfo_t *) SD->fsdata; + int L1 = aioinfo->l1; + int L2 = aioinfo->l2; + if (!fullpath) + fullpath = fullfilename; + fullpath[0] = '\0'; + snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X", + SD->path, + ((filn / L2) / L2) % L1, + (filn / L2) % L2, + filn); + return fullpath; +} + +/* + * storeAufsCleanupDoubleCheck + * + * This is called by storeCleanup() if -S was given on the command line. + */ +static int +storeAufsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) +{ + struct stat sb; + if (stat(storeAufsDirFullPath(sd, e->swap_filen, NULL), &sb) < 0) { + debug(47, 0) ("storeAufsCleanupDoubleCheck: MISSING SWAP FILE\n"); + debug(47, 0) ("storeAufsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeAufsCleanupDoubleCheck: PATH %s\n", + storeAufsDirFullPath(sd, e->swap_filen, NULL)); + storeEntryDump(e, 0); + return -1; + } + if (e->swap_file_sz != sb.st_size) { + debug(47, 0) ("storeAufsCleanupDoubleCheck: SIZE MISMATCH\n"); + debug(47, 0) ("storeAufsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeAufsCleanupDoubleCheck: PATH %s\n", + storeAufsDirFullPath(sd, e->swap_filen, NULL)); + debug(47, 0) ("storeAufsCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", + (long int) e->swap_file_sz, (long int) sb.st_size); + storeEntryDump(e, 0); + return -1; + } + return 0; +} + +/* + * storeAufsDirParse * + * Called when a *new* fs is being setup. + */ +static void +storeAufsDirParse(SwapDir * sd, int index, char *path) +{ + int i; + int size; + int l1; + int l2; + squidaioinfo_t *aioinfo; + + i = GetInteger(); + size = i << 10; /* Mbytes to kbytes */ + if (size <= 0) + fatal("storeAufsDirParse: invalid size value"); + i = GetInteger(); + l1 = i; + if (l1 <= 0) + fatal("storeAufsDirParse: invalid level 1 directories value"); + i = GetInteger(); + l2 = i; + if (l2 <= 0) + fatal("storeAufsDirParse: invalid level 2 directories value"); + + aioinfo = xmalloc(sizeof(squidaioinfo_t)); + if (aioinfo == NULL) + fatal("storeAufsDirParse: couldn't xmalloc() squidaioinfo_t!\n"); + + sd->index = index; + sd->path = xstrdup(path); + sd->max_size = size; + sd->fsdata = aioinfo; + aioinfo->l1 = l1; + aioinfo->l2 = l2; + aioinfo->swaplog_fd = -1; + aioinfo->map = NULL; /* Debugging purposes */ + aioinfo->suggest = 0; + sd->init = storeAufsDirInit; + sd->newfs = storeAufsDirNewfs; + sd->dump = storeAufsDirDump; + sd->freefs = storeAufsDirFree; + sd->dblcheck = storeAufsCleanupDoubleCheck; + sd->statfs = storeAufsDirStats; + sd->maintainfs = storeAufsDirMaintain; + sd->checkobj = storeAufsDirCheckObj; + sd->refobj = storeAufsDirRefObj; + sd->unrefobj = storeAufsDirUnrefObj; + sd->callback = aioCheckCallbacks; + sd->sync = aioSync; + sd->obj.create = storeAufsCreate; + sd->obj.open = storeAufsOpen; + sd->obj.close = storeAufsClose; + sd->obj.read = storeAufsRead; + sd->obj.write = storeAufsWrite; + sd->obj.unlink = storeAufsUnlink; + sd->log.open = storeAufsDirOpenSwapLog; + sd->log.close = storeAufsDirCloseSwapLog; + sd->log.write = storeAufsDirSwapLog; + sd->log.clean.start = storeAufsDirWriteCleanStart; + sd->log.clean.nextentry = storeAufsDirCleanLogNextEntry; + sd->log.clean.done = storeAufsDirWriteCleanDone; + + parse_cachedir_options(sd, options, 0); + + /* Initialise replacement policy stuff */ + sd->repl = createRemovalPolicy(Config.replPolicy); + + asyncufs_dir_index = realloc(asyncufs_dir_index, (n_asyncufs_dirs + 1) * sizeof(*asyncufs_dir_index)); + asyncufs_dir_index[n_asyncufs_dirs++] = index; +} + +/* + * Initial setup / end destruction + */ +static void +storeAufsDirDone(void) +{ + aioDone(); + memPoolDestroy(squidaio_state_pool); + memPoolDestroy(aufs_qread_pool); + memPoolDestroy(aufs_qwrite_pool); + asyncufs_initialised = 0; +} + +void +storeFsSetup_awin32(storefs_entry_t * storefs) +{ + assert(!asyncufs_initialised); + storefs->parsefunc = storeAufsDirParse; + storefs->reconfigurefunc = storeAufsDirReconfigure; + storefs->donefunc = storeAufsDirDone; + squidaio_state_pool = memPoolCreate("AWIN32 IO State data", sizeof(squidaiostate_t)); + aufs_qread_pool = memPoolCreate("AWIN32 Queued read data", + sizeof(queued_read)); + aufs_qwrite_pool = memPoolCreate("AWIN32 Queued write data", + sizeof(queued_write)); + + asyncufs_initialised = 1; + aioInit(); +} Index: squid/src/fs/awin32/store_io_aufs.c diff -u /dev/null squid/src/fs/awin32/store_io_aufs.c:1.1.62.18 --- /dev/null Thu Jan 1 01:00:00 1970 +++ squid/src/fs/awin32/store_io_aufs.c Sat Mar 26 03:11:20 2005 @@ -0,0 +1,534 @@ + +/* + * $Id$ + * + * DEBUG: section 79 Storage Manager awin32 Interface + * AUTHOR: Robert Collins + * + * 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 "store_asyncufs.h" + +#if ASYNC_READ +static AIOCB storeAufsReadDone; +#else +static DRCB storeAufsReadDone; +#endif +#if ASYNC_WRITE +static AIOCB storeAufsWriteDone; +#else +static DWCB storeAufsWriteDone; +#endif +static void storeAufsIOCallback(storeIOState * sio, int errflag); +static AIOCB storeAufsOpenDone; +static int storeAufsNeedCompletetion(storeIOState *); +static int storeAufsKickWriteQueue(storeIOState * sio); +static CBDUNL storeAufsIOFreeEntry; + +CBDATA_TYPE(storeIOState); + +/* === PUBLIC =========================================================== */ + +/* open for reading */ +storeIOState * +storeAufsOpen(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, + STIOCB * callback, void *callback_data) +{ + sfileno f = e->swap_filen; + char *path = storeAufsDirFullPath(SD, f, NULL); + storeIOState *sio; +#if !ASYNC_OPEN + int fd; +#endif + debug(79, 3) ("storeAufsOpen: fileno %08X\n", f); + /* + * we should detect some 'too many files open' condition and return + * NULL here. + */ +#ifdef MAGIC2 + if (aioQueueSize() > MAGIC2) + return NULL; +#endif +#if !ASYNC_OPEN + fd = file_open(path, O_RDONLY | O_BINARY); + if (fd < 0) { + debug(79, 3) ("storeAufsOpen: got failure (%d)\n", errno); + return NULL; + } +#endif + CBDATA_INIT_TYPE_FREECB(storeIOState, storeAufsIOFreeEntry); + sio = cbdataAlloc(storeIOState); + sio->fsstate = memPoolAlloc(squidaio_state_pool); + ((squidaiostate_t *) (sio->fsstate))->fd = -1; + ((squidaiostate_t *) (sio->fsstate))->flags.opening = 1; + sio->swap_filen = f; + sio->swap_dirn = SD->index; + sio->mode = O_RDONLY | O_BINARY; + sio->callback = callback; + sio->callback_data = callback_data; + sio->e = e; + cbdataLock(callback_data); + Opening_FD++; + statCounter.syscalls.disk.opens++; +#if ASYNC_OPEN + aioOpen(path, O_RDONLY | O_BINARY, 0644, storeAufsOpenDone, sio); +#else + storeAufsOpenDone(fd, sio, fd, 0); +#endif + return sio; +} + +/* open for creating */ +storeIOState * +storeAufsCreate(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, STIOCB * callback, void *callback_data) +{ + char *path; + storeIOState *sio; + sfileno filn; + sdirno dirn; +#if !ASYNC_CREATE + int fd; +#endif + + /* Allocate a number */ + dirn = SD->index; + filn = storeAufsDirMapBitAllocate(SD); + path = storeAufsDirFullPath(SD, filn, NULL); + + debug(79, 3) ("storeAufsCreate: fileno %08X\n", filn); + /* + * we should detect some 'too many files open' condition and return + * NULL here. + */ +#ifdef MAGIC2 + if (aioQueueSize() > MAGIC2) + return NULL; +#endif +#if !ASYNC_CREATE + fd = file_open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY); + if (fd < 0) { + debug(79, 3) ("storeAufsCreate: got failure (%d)\n", errno); + return NULL; + } +#endif + CBDATA_INIT_TYPE_FREECB(storeIOState, storeAufsIOFreeEntry); + sio = cbdataAlloc(storeIOState); + sio->fsstate = memPoolAlloc(squidaio_state_pool); + ((squidaiostate_t *) (sio->fsstate))->fd = -1; + ((squidaiostate_t *) (sio->fsstate))->flags.opening = 1; + sio->swap_filen = filn; + sio->swap_dirn = dirn; + sio->mode = O_WRONLY | O_BINARY; + sio->callback = callback; + sio->callback_data = callback_data; + sio->e = (StoreEntry *) e; + cbdataLock(callback_data); + Opening_FD++; + statCounter.syscalls.disk.opens++; +#if ASYNC_CREATE + aioOpen(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644, storeAufsOpenDone, sio); +#else + storeAufsOpenDone(fd, sio, fd, 0); +#endif + + /* now insert into the replacement policy */ + storeAufsDirReplAdd(SD, e); + return sio; + +} + + + +/* Close */ +void +storeAufsClose(SwapDir * SD, storeIOState * sio) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + debug(79, 3) ("storeAufsClose: dirno %d, fileno %08X, FD %d\n", + sio->swap_dirn, sio->swap_filen, aiostate->fd); + if (storeAufsNeedCompletetion(sio)) { + aiostate->flags.close_request = 1; + return; + } + storeAufsIOCallback(sio, DISK_OK); +} + + +/* Read */ +void +storeAufsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + assert(sio->read.callback == NULL); + assert(sio->read.callback_data == NULL); + assert(!aiostate->flags.reading); + if (aiostate->fd < 0) { + struct _queued_read *q; + debug(79, 3) ("storeAufsRead: queueing read because FD < 0\n"); + assert(aiostate->flags.opening); + assert(aiostate->pending_reads == NULL); + q = memPoolAlloc(aufs_qread_pool); + q->buf = buf; + q->size = size; + q->offset = (off_t) offset; + q->callback = callback; + q->callback_data = callback_data; + cbdataLock(q->callback_data); + linklistPush(&(aiostate->pending_reads), q); + return; + } + sio->read.callback = callback; + sio->read.callback_data = callback_data; + aiostate->read_buf = buf; + cbdataLock(callback_data); + debug(79, 3) ("storeAufsRead: dirno %d, fileno %08X, FD %d\n", + sio->swap_dirn, sio->swap_filen, aiostate->fd); + sio->offset = offset; + aiostate->flags.reading = 1; +#if ASYNC_READ + aioRead(aiostate->fd, (off_t) offset, size, storeAufsReadDone, sio); + statCounter.syscalls.disk.reads++; +#else + file_read(aiostate->fd, buf, size, (off_t) offset, storeAufsReadDone, sio); + /* file_read() increments syscalls.disk.reads */ +#endif +} + + +/* Write */ +void +storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + debug(79, 3) ("storeAufsWrite: dirno %d, fileno %08X, FD %d\n", + sio->swap_dirn, sio->swap_filen, aiostate->fd); + if (aiostate->fd < 0) { + /* disk file not opened yet */ + struct _queued_write *q; + assert(aiostate->flags.opening); + q = memPoolAlloc(aufs_qwrite_pool); + q->buf = buf; + q->size = size; + q->offset = (off_t) offset; + q->free_func = free_func; + linklistPush(&(aiostate->pending_writes), q); + return; + } +#if ASYNC_WRITE + if (aiostate->flags.writing) { + struct _queued_write *q; + debug(79, 3) ("storeAufsWrite: queuing write\n"); + q = memPoolAlloc(aufs_qwrite_pool); + q->buf = buf; + q->size = size; + q->offset = (off_t) offset; + q->free_func = free_func; + linklistPush(&(aiostate->pending_writes), q); + return; + } + aiostate->flags.writing = 1; + aioWrite(aiostate->fd, (off_t) offset, buf, size, storeAufsWriteDone, sio, + free_func); + statCounter.syscalls.disk.writes++; +#else + file_write(aiostate->fd, (off_t) offset, buf, size, storeAufsWriteDone, sio, + free_func); + /* file_write() increments syscalls.disk.writes */ +#endif +} + +/* Unlink */ +void +storeAufsUnlink(SwapDir * SD, StoreEntry * e) +{ + debug(79, 3) ("storeAufsUnlink: dirno %d, fileno %08X\n", SD->index, e->swap_filen); + storeAufsDirReplRemove(e); + storeAufsDirMapBitReset(SD, e->swap_filen); + storeAufsDirUnlinkFile(SD, e->swap_filen); + statCounter.syscalls.disk.unlinks++; +} + +/* === STATIC =========================================================== */ + +static int +storeAufsKickWriteQueue(storeIOState * sio) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + struct _queued_write *q = linklistShift(&aiostate->pending_writes); + if (NULL == q) + return 0; + debug(79, 3) ("storeAufsKickWriteQueue: writing queued chunk of %ld bytes\n", + (long int) q->size); + storeAufsWrite(INDEXSD(sio->swap_dirn), sio, q->buf, q->size, q->offset, q->free_func); + memPoolFree(aufs_qwrite_pool, q); + return 1; +} + +static int +storeAufsKickReadQueue(storeIOState * sio) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + struct _queued_read *q = linklistShift(&(aiostate->pending_reads)); + if (NULL == q) + return 0; + debug(79, 3) ("storeAufsKickReadQueue: reading queued request of %ld bytes\n", + (long int) q->size); + if (cbdataValid(q->callback_data)) + storeAufsRead(INDEXSD(sio->swap_dirn), sio, q->buf, q->size, q->offset, q->callback, q->callback_data); + cbdataUnlock(q->callback_data); + memPoolFree(aufs_qread_pool, q); + return 1; +} + +static void +storeAufsOpenDone(int unused, void *my_data, const char *unused2, int fd, int errflag) +{ + storeIOState *sio = my_data; + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + debug(79, 3) ("storeAufsOpenDone: FD %d, errflag %d\n", fd, errflag); + Opening_FD--; + aiostate->flags.opening = 0; + if (errflag || fd < 0) { + errno = errflag; + debug(79, 0) ("storeAufsOpenDone: %s\n", xstrerror()); + debug(79, 1) ("\t%s\n", storeAufsDirFullPath(INDEXSD(sio->swap_dirn), sio->swap_filen, NULL)); + storeAufsIOCallback(sio, DISK_ERROR); + return; + } + store_open_disk_fd++; + aiostate->fd = fd; + commSetCloseOnExec(fd); + fd_open(fd, FD_FILE, storeAufsDirFullPath(INDEXSD(sio->swap_dirn), sio->swap_filen, NULL)); + if (FILE_MODE(sio->mode) == O_WRONLY) { + if (storeAufsKickWriteQueue(sio)) + return; + } else if ((FILE_MODE(sio->mode) == O_RDONLY) && !aiostate->flags.close_request) { + if (storeAufsKickReadQueue(sio)) + return; + } + if (aiostate->flags.close_request) + storeAufsIOCallback(sio, errflag); + debug(79, 3) ("storeAufsOpenDone: exiting\n"); +} + +#if ASYNC_READ +static void +storeAufsReadDone(int fd, void *my_data, const char *buf, int len, int errflag) +#else +static void +storeAufsReadDone(int fd, const char *buf, int len, int errflag, void *my_data) +#endif +{ + storeIOState *sio = my_data; + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + STRCB *callback = sio->read.callback; + void *their_data = sio->read.callback_data; + ssize_t rlen; + int inreaddone = aiostate->flags.inreaddone; /* Protect from callback loops */ + debug(79, 3) ("storeAufsReadDone: dirno %d, fileno %08X, FD %d, len %d\n", + sio->swap_dirn, sio->swap_filen, fd, len); + aiostate->flags.inreaddone = 1; + aiostate->flags.reading = 0; + if (errflag) { + debug(79, 3) ("storeAufsReadDone: got failure (%d)\n", errflag); + rlen = -1; + } else { + rlen = len; + sio->offset += len; + } +#if ASYNC_READ + /* translate errflag from errno to Squid disk error */ + errno = errflag; + if (errflag) + errflag = DISK_ERROR; + else + errflag = DISK_OK; +#else + if (errflag == DISK_EOF) + errflag = DISK_OK; /* EOF is signalled by len == 0, not errors... */ +#endif + assert(callback); + assert(their_data); + sio->read.callback = NULL; + sio->read.callback_data = NULL; + if (!aiostate->flags.close_request && cbdataValid(their_data)) { +#if ASYNC_READ + if (rlen > 0) + memcpy(aiostate->read_buf, buf, rlen); +#endif + callback(their_data, aiostate->read_buf, rlen); + } + cbdataUnlock(their_data); + aiostate->flags.inreaddone = 0; + if (aiostate->flags.close_request && !inreaddone) + storeAufsIOCallback(sio, errflag); +} + +#if ASYNC_WRITE +static void +storeAufsWriteDone(int fd, void *my_data, const char *buf, int aio_return, int aio_errno) +#else +static void +storeAufsWriteDone(int fd, int errflag, size_t len, void *my_data) +#endif +{ + static int loop_detect = 0; + storeIOState *sio = my_data; + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; +#if ASYNC_WRITE + int errflag; + int len = aio_return; + /* Translate from errno to Squid disk error */ + if (aio_errno) + errflag = aio_errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR; + else + errflag = DISK_OK; +#endif + debug(79, 3) ("storeAufsWriteDone: dirno %d, fileno %08X, FD %d, len %ld, err=%d\n", + sio->swap_dirn, sio->swap_filen, fd, (long int) len, errflag); + assert(++loop_detect < 10); + aiostate->flags.writing = 0; + if (errflag) { + debug(79, 0) ("storeAufsWriteDone: got failure (%d)\n", errflag); + storeAufsIOCallback(sio, errflag); + loop_detect--; + return; + } + sio->offset += len; +#if ASYNC_WRITE + if (storeAufsKickWriteQueue(sio)) + (void) 0; + else if (aiostate->flags.close_request) + storeAufsIOCallback(sio, errflag); +#else + /* loop around storeAufsKickWriteQueue to break recursion stack + * overflow when large amounts of data has been queued for write. + * As writes are blocking here we immediately get called again + * without going via the I/O event loop.. + */ + if (!aiostate->flags.write_kicking) { + /* cbdataLock to protect us from the storeAufsIOCallback on error above */ + cbdataLock(sio); + aiostate->flags.write_kicking = 1; + while (storeAufsKickWriteQueue(sio)) + if (!cbdataValid(sio)) + break; + if (cbdataValid(sio)) { + aiostate->flags.write_kicking = 0; + if (aiostate->flags.close_request) + storeAufsIOCallback(sio, errflag); + } + cbdataUnlock(sio); + } +#endif + loop_detect--; +} + +static void +storeAufsIOCallback(storeIOState * sio, int errflag) +{ + STIOCB *callback = sio->callback; + void *their_data = sio->callback_data; + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + int fd = aiostate->fd; + debug(79, 3) ("storeAufsIOCallback: errflag=%d\n", errflag); + sio->callback = NULL; + sio->callback_data = NULL; + debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); + if (callback) + if (NULL == their_data || cbdataValid(their_data)) + callback(their_data, errflag, sio); + debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); + cbdataUnlock(their_data); + aiostate->fd = -1; + if (aiostate->flags.opening) + Opening_FD--; + cbdataFree(sio); + if (fd < 0) + return; + debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); +#if ASYNC_CLOSE + aioClose(fd); + fd_close(fd); +#else + aioCancel(fd); + file_close(fd); +#endif + store_open_disk_fd--; + statCounter.syscalls.disk.closes++; + debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); +} + + +static int +storeAufsNeedCompletetion(storeIOState * sio) +{ + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + + if (aiostate->flags.writing) + return 1; + if (aiostate->flags.opening && FILE_MODE(sio->mode) == O_WRONLY) + return 1; + if (aiostate->flags.reading) + return 1; + if (aiostate->flags.inreaddone) + return 1; + + return 0; +} + + +/* + * Clean up references from the SIO before it gets released. + * The actuall SIO is managed by cbdata so we do not need + * to bother with that. + */ +static void +storeAufsIOFreeEntry(void *siop) +{ + storeIOState *sio = (storeIOState *) siop; + squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; + struct _queued_write *qw; + struct _queued_read *qr; + while ((qw = linklistShift(&aiostate->pending_writes))) { + if (qw->free_func) + qw->free_func(qw->buf); + memPoolFree(aufs_qwrite_pool, qw); + } + while ((qr = linklistShift(&aiostate->pending_reads))) { + cbdataUnlock(qr->callback_data); + memPoolFree(aufs_qread_pool, qr); + } + if (sio->read.callback_data) + cbdataUnlock(sio->read.callback_data); + if (sio->callback_data) + cbdataUnlock(sio->callback_data); + memPoolFree(squidaio_state_pool, aiostate); +} Index: squid/src/fs/diskd/Makefile.am diff -u squid/src/fs/diskd/Makefile.am:1.2 squid/src/fs/diskd/Makefile.am:1.2.40.1 --- squid/src/fs/diskd/Makefile.am:1.2 Sat Sep 1 04:46:51 2001 +++ squid/src/fs/diskd/Makefile.am Sat Nov 23 06:51:36 2002 @@ -4,8 +4,5 @@ # $Id$ # -libexec_PROGRAMS = diskd -LDADD = $(top_builddir)/lib/libmiscutil.a @XTRA_LIBS@ - -INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/ +all clean: + @cd .. && $(MAKE) $(MFLAGS) diskd/$@ Index: squid/src/fs/ufs/store_dir_ufs.c diff -u squid/src/fs/ufs/store_dir_ufs.c:1.21.6.13 squid/src/fs/ufs/store_dir_ufs.c:1.21.6.1.4.20 --- squid/src/fs/ufs/store_dir_ufs.c:1.21.6.13 Sat Mar 26 18:16:20 2005 +++ squid/src/fs/ufs/store_dir_ufs.c Sat Mar 26 23:51:25 2005 @@ -214,7 +214,11 @@ } else { fatalf("Swap directory %s is not a directory.", path); } +#ifdef _SQUID_MSWIN_ + } else if (0 == mkdir(path)) { +#else } else if (0 == mkdir(path, 0755)) { +#endif debug(47, should_exist ? 1 : 3) ("%s created\n", path); created = 1; } else { @@ -1176,14 +1180,11 @@ ufsinfo->swaplog_fd = fd; storeUfsWriteSwapLogheader(fd); /* open a read-only stream of the old log */ - fp = fopen(swaplog_path, "r"); + fp = fopen(swaplog_path, "rb"); if (fp == NULL) { debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); fatal("Failed to open swap log for reading"); } -#if defined(_SQUID_CYGWIN_) - setmode(fileno(fp), O_BINARY); -#endif memset(&clean_sb, '\0', sizeof(struct stat)); if (stat(clean_path, &clean_sb) < 0) *clean_flag = 0; @@ -1433,7 +1434,11 @@ if (dp == NULL) { if (errno == ENOENT) { debug(36, 0) ("storeDirClean: WARNING: Creating %s\n", p1); +#ifdef _SQUID_MSWIN_ + if (mkdir(p1) == 0) +#else if (mkdir(p1, 0777) == 0) +#endif return 0; } debug(50, 0) ("storeDirClean: %s: %s\n", p1, xstrerror()); Index: squid/src/repl/Makefile.am diff -u squid/src/repl/Makefile.am:1.2.32.1 squid/src/repl/Makefile.am:1.2.32.1.4.1 --- squid/src/repl/Makefile.am:1.2.32.1 Wed Dec 26 18:28:54 2001 +++ squid/src/repl/Makefile.am Sun Oct 27 03:14:57 2002 @@ -16,8 +16,11 @@ liblru_a_SOURCES = lru/store_repl_lru.c libheap_a_SOURCES = heap/store_heap_replacement.h heap/store_heap_replacement.c heap/store_repl_heap.c -INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/ +if ENABLE_WIN32SPECIFIC +INCLUDES = -I. -I$(top_srcdir)/port/win32/include -I$(top_srcdir)/include -I$(top_srcdir)/src +else +INCLUDES = -I. -I$(top_srcdir)/include -I$(top_srcdir)/src +endif ##all: ## @test -z "$(SUBDIRS)" || for dir in $(SUBDIRS); do \