---------------------
PatchSet 3202 
Date: 2001/10/19 19:05:08
Author: serassio
Branch: cygwin
Tag: (none) 
Log:
Manually merged changes from HEAD after cvsmerge crash

Members: 
	.cvsignore:1.1->1.1.14.1 
	ChangeLog:1.6.14.2->1.6.14.3 
	configure.in:1.8.2.18->1.8.2.19 
	contrib/.cvsignore:1.3->1.3.12.1 
	include/.cvsignore:1.3->1.3.12.1 
	include/Array.h:1.2.28.1->1.2.28.2 
	include/GNUregex.h:1.2->1.2.28.1 
	include/Stack.h:1.2.28.1->1.2.28.2 
	include/asn1.h:1.2.28.1->1.2.28.2 
	include/cache_snmp.h:1.2->1.2.28.1 
	include/hash.h:1.3->1.3.26.1 
	include/heap.h:1.3.30.1->1.3.30.2 
	include/md5.h:1.2.28.2->1.2.28.3 
	include/ntlmauth.h:1.1.22.2->1.1.22.3 
	include/parse.h:1.2.28.1->1.2.28.2 
	include/radix.h:1.2.28.1->1.2.28.2 
	include/rfc1035.h:1.3.28.1->1.3.28.2 
	include/rfc2617.h:1.1.16.2->1.1.16.3 
	include/snmp-internal.h:1.2.28.2->1.2.28.3 
	include/snmp-mib.h:1.2->1.2.28.1 
	include/snmp.h:1.2->1.2.28.1 
	include/snmp_api.h:1.2->1.2.28.1 
	include/snmp_api_error.h:1.2->1.2.28.1 
	include/snmp_api_util.h:1.2->1.2.28.1 
	include/snmp_client.h:1.2.28.1->1.2.28.2 
	include/snmp_coexist.h:1.2->1.2.28.1 
	include/snmp_compat.h:1.2->1.2.28.1 
	include/snmp_debug.h:1.2->1.2.28.1 
	include/snmp_error.h:1.2->1.2.28.1 
	include/snmp_impl.h:1.2->1.2.28.1 
	include/snmp_msg.h:1.2->1.2.28.1 
	include/snmp_pdu.h:1.2.28.1->1.2.28.2 
	include/snmp_session.h:1.2->1.2.28.1 
	include/snmp_util.h:1.2.28.1->1.2.28.2 
	include/snmp_vars.h:1.2.28.1->1.2.28.2 
	include/snprintf.h:1.2.28.1->1.2.28.2 
	include/splay.h:1.3.28.1->1.3.28.2 
	include/squid_types.h:1.1.18.1->1.1.18.2 
	include/tempnam.h:1.2->1.2.28.1 
	include/util.h:1.4.20.2->1.4.20.3 
	lib/.cvsignore:1.3->1.3.12.1 
	lib/md5.c:1.2.28.2->1.2.28.3 
	lib/ntlmauth.c:1.1.22.2->1.1.22.3 
	lib/radix.c:1.3.28.2->1.3.28.3 
	lib/rfc1035.c:1.4.26.1->1.4.26.2 
	lib/rfc2617.c:1.1.16.2->1.1.16.3 
	lib/util.c:1.4.14.3->1.4.14.4 
	src/.cvsignore:1.3->1.3.12.1 
	src/HttpHeader.c:1.4.2.2->1.4.2.3 
	src/Makefile.am:1.2.6.3->1.2.6.4 
	src/access_log.c:1.6.4.3->1.6.4.4 
	src/acl.c:1.6.2.9->1.6.2.10 
	src/asn.c:1.5.4.1->1.5.4.2 
	src/authenticate.c:1.4.20.6->1.4.20.7 
	src/cache_cf.c:1.6.10.12->1.6.10.13 
	src/cf.data.pre:1.10.2.13->1.10.2.14 
	src/comm.c:1.4.20.4->1.4.20.5 
	src/defines.h:1.3.22.14->1.3.22.15 
	src/enums.h:1.6.10.5->1.6.10.6 
	src/forward.c:1.6.4.1->1.6.4.2 
	src/ftp.c:1.5.16.3->1.5.16.4 
	src/globals.h:1.5.12.13->1.5.12.14 
	src/mk-globals-c.pl:1.1.1.1->1.1.1.1.72.1 
	src/neighbors.c:1.6.10.3->1.6.10.4 
	src/protos.h:1.9.2.16->1.9.2.17 
	src/ssl.c:1.3.22.3->1.3.22.4 
	src/ssl_support.h:1.1.30.2->1.1.30.3 
	src/store_rebuild.c:1.6.16.1->1.6.16.2 
	src/structs.h:1.12.2.11->1.12.2.12 
	src/typedefs.h:1.4.16.7->1.4.16.8 
	src/auth/basic/auth_basic.c:1.1.24.5->1.1.24.6 
	src/auth/basic/auth_basic.h:1.1.22.2->1.1.22.3 
	src/auth/basic/helpers/LDAP/squid_ldap_auth.8:1.1.14.4->1.1.14.5 
	src/auth/basic/helpers/LDAP/squid_ldap_auth.c:1.2.30.7->1.2.30.8 
	src/auth/digest/auth_digest.c:1.1.16.3->1.1.16.4 
	src/auth/digest/auth_digest.h:1.1.16.2->1.1.16.3 
	src/auth/ntlm/auth_ntlm.c:1.1.24.5->1.1.24.6 
	src/auth/ntlm/auth_ntlm.h:1.1.22.4->1.1.22.5 
	src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c:1.4.16.2->1.4.16.3 
	src/auth/ntlm/helpers/NTLMSSP/ntlm.h:1.4.2.3->1.4.2.4 
	src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c:1.6.2.4->1.6.2.5 
	src/fs/aufs/aiops.c:1.4.16.3->1.4.16.4 
	src/fs/aufs/async_io.c:1.3.24.2->1.3.24.3 
	src/fs/aufs/store_dir_aufs.c:1.6.10.6->1.6.10.7 
	src/fs/diskd/store_dir_diskd.c:1.5.10.7->1.5.10.8 
	src/fs/ufs/store_dir_ufs.c:1.5.10.9->1.5.10.10 

Index: squid/ChangeLog
===================================================================
RCS file: /cvsroot/squid-sf//squid/ChangeLog,v
retrieving revision 1.6.14.2
retrieving revision 1.6.14.3
diff -u -r1.6.14.2 -r1.6.14.3
--- squid/ChangeLog	2 Sep 2001 08:46:07 -0000	1.6.14.2
+++ squid/ChangeLog	19 Oct 2001 19:05:08 -0000	1.6.14.3
@@ -28,6 +28,11 @@
 	  as the dist-all and distcheck targets for developers which respectively
 	  build a tar.gz and a tar.bz2 distribution, and check that what will be
 	  distributed builds.
+	- Added TOS and source address selection based on ACLs,
+	  written by Roger Venning. This allows administrators to set
+	  the TOS precedence bits and/or the source IP from a set of
+	  available IPs based upon some ACLs, generally to map different
+	  users to different outgoing links and traffic profiles.
 	
 Changes to Squid-2.4.DEVEL4 ():
 
Index: squid/configure.in
===================================================================
RCS file: /cvsroot/squid-sf//squid/configure.in,v
retrieving revision 1.8.2.18
retrieving revision 1.8.2.19
diff -u -r1.8.2.18 -r1.8.2.19
--- squid/configure.in	4 Oct 2001 19:50:28 -0000	1.8.2.18
+++ squid/configure.in	19 Oct 2001 19:05:08 -0000	1.8.2.19
@@ -3,7 +3,7 @@
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.8.2.18 2001/10/04 19:50:28 serassio Exp $
+dnl  $Id: configure.in,v 1.8.2.19 2001/10/19 19:05:08 serassio Exp $
 dnl
 dnl
 dnl
@@ -11,7 +11,7 @@
 AC_CONFIG_AUX_DIR(cfgaux)
 AM_INIT_AUTOMAKE(Squid, 2.5-DEVEL)
 AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.8.2.18 $)dnl
+AC_REVISION($Revision: 1.8.2.19 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AM_MAINTAINER_MODE
 
@@ -320,6 +320,13 @@
             fi
         fi
     ;;
+    *-solaris2.*)
+        if test "$GCC" = "yes" ; then
+	    CFLAGS="$CFLAGS -pthreads"
+	else
+	    CFLAGS="$CFLAGS -mt"
+        fi
+    ;;
     esac
 fi
 AC_SUBST(SQUID_PTHREAD_LIB)
@@ -780,6 +787,7 @@
   fi
 ])
 
+
 dnl Select auth schemes modules to build
 AC_ARG_ENABLE(auth,
 [  --enable-auth=\"list of auth scheme modules\"
@@ -2051,6 +2059,7 @@
 	src/auth/basic/helpers/NCSA/Makefile \
 	src/auth/basic/helpers/PAM/Makefile \
 	src/auth/basic/helpers/SMB/Makefile \
+	src/auth/basic/helpers/win32_locallogon/Makefile \
 	src/auth/basic/helpers/YP/Makefile \
 	src/auth/basic/helpers/getpwnam/Makefile \
 	src/auth/basic/helpers/multi-domain-NTLM/Makefile \
Index: squid/contrib/.cvsignore
===================================================================
RCS file: /cvsroot/squid-sf//squid/contrib/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.3.12.1
diff -u -r1.3 -r1.3.12.1
--- squid/contrib/.cvsignore	11 Oct 2001 12:23:40 -0000	1.3
+++ squid/contrib/.cvsignore	19 Oct 2001 19:05:08 -0000	1.3.12.1
@@ -1,2 +1,3 @@
-.cvsignore
-Makefile.in
+.cvsignore
+Makefile.in
+win
Index: squid/include/Array.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/Array.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/Array.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/Array.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,5 +1,5 @@
 /*
- * $Id: Array.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: Array.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -31,8 +31,8 @@
  *  
  */
 
-#ifndef _ARRAY_H_
-#define _ARRAY_H_
+#ifndef SQUID_ARRAY_H
+#define SQUID_ARRAY_H
 
 /* see Array.c for more documentation */
 
@@ -51,4 +51,4 @@
 extern void arrayPreAppend(Array * s, int app_count);
 
 
-#endif /* ndef _ARRAY_H_ */
+#endif /* SQUID_ARRAY_H */
Index: squid/include/GNUregex.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/GNUregex.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/GNUregex.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/GNUregex.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,7 +1,10 @@
 /*
- * $Id: GNUregex.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: GNUregex.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
+#ifndef SQUID_REGEXP_LIBRARY_H
+#define SQUID_REGEXP_LIBRARY_H
+
 /* Definitions for data structures and routines for the regular
  * expression library, version 0.12.
  * 
@@ -21,9 +24,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.  */
 
-#ifndef __REGEXP_LIBRARY_H__
-#define __REGEXP_LIBRARY_H__
-
 /* POSIX says that <sys/types.h> must be included (by the caller) before
  * <regex.h>.  */
 
@@ -479,7 +479,7 @@
 	size_t errbuf_size));
 extern void regfree _RE_ARGS((regex_t * preg));
 
-#endif /* not __REGEXP_LIBRARY_H__ */
+#endif /* SQUID_REGEXP_LIBRARY_H */
 
 /*
  * Local variables:
Index: squid/include/Stack.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/Stack.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/Stack.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/Stack.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,5 +1,5 @@
 /*
- * $Id: Stack.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: Stack.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -31,8 +31,8 @@
  *  
  */
 
-#ifndef _STACK_H_
-#define _STACK_H_
+#ifndef SQUID_STACK_H
+#define SQUID_STACK_H
 
 #include "Array.h"
 
@@ -47,4 +47,4 @@
 #define stackPrePush arrayPreAppend
 extern void *stackTop(Stack * s);
 
-#endif /* ndef _STACK_H_ */
+#endif /* SQUID_STACK_H */
Index: squid/include/asn1.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/asn1.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/asn1.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/asn1.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,5 +1,5 @@
-#ifndef _SNMP_ASN1_H_
-#define _SNMP_ASN1_H_
+#ifndef SQUID_SNMP_ASN1_H
+#define SQUID_SNMP_ASN1_H
 
 /*
  * Definitions for Abstract Syntax Notation One, ASN.1
@@ -28,7 +28,7 @@
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  * 
- * $Id: asn1.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: asn1.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -98,4 +98,5 @@
 }
 
 #endif
-#endif				/* _SNMP_ASN1_H_ */
+
+#endif	/* SQUID_SNMP_ASN1_H */
Index: squid/include/cache_snmp.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/cache_snmp.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/cache_snmp.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/cache_snmp.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,10 +1,11 @@
 /*
- * $Id: cache_snmp.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: cache_snmp.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
+#ifndef SQUID_CACHE_SNMP_H
+#define SQUID_CACHE_SNMP_H
+
 #ifdef SQUID_SNMP
-#ifndef CACHE_SNMP_H
-#define CACHE_SNMP_H
 
 #if SIZEOF_LONG == 8
 #define snint int
@@ -253,5 +254,6 @@
     PERF_MEDIAN_END
 };
 
-#endif
-#endif
+#endif /* SQUID_SNMP */
+
+#endif /* SQUID_CACHE_SNMP_H */
Index: squid/include/hash.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/hash.h,v
retrieving revision 1.3
retrieving revision 1.3.26.1
diff -u -r1.3 -r1.3.26.1
--- squid/include/hash.h	3 Nov 2000 08:39:19 -0000	1.3
+++ squid/include/hash.h	19 Oct 2001 19:05:08 -0000	1.3.26.1
@@ -1,7 +1,10 @@
 /*
- * $Id: hash.h,v 1.3 2000/11/03 08:39:19 hno Exp $
+ * $Id: hash.h,v 1.3.26.1 2001/10/19 19:05:08 serassio Exp $
  */
 
+#ifndef SQUID_HASH_H
+#define SQUID_HASH_H
+
 typedef void HASHFREE(void *);
 typedef int HASHCMP(const void *, const void *);
 typedef unsigned int HASHHASH(const void *, unsigned int);
@@ -56,3 +59,5 @@
  *  HASH_SIZE 65357             // prime number < 65536
  */
 #define  DEFAULT_HASH_SIZE 7951	/* prime number < 8192 */
+
+#endif /* SQUID_HASH_H */
Index: squid/include/heap.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/heap.h,v
retrieving revision 1.3.30.1
retrieving revision 1.3.30.2
diff -u -r1.3.30.1 -r1.3.30.2
--- squid/include/heap.h	14 Mar 2001 22:17:32 -0000	1.3.30.1
+++ squid/include/heap.h	19 Oct 2001 19:05:08 -0000	1.3.30.2
@@ -1,5 +1,5 @@
 /*
- * $Id: heap.h,v 1.3.30.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: heap.h,v 1.3.30.2 2001/10/19 19:05:08 serassio Exp $
  *
  * AUTHOR: John Dilley, Hewlett Packard
  *
@@ -41,8 +41,8 @@
  * are larger than their parent.
  ****************************************************************************/
 
-#ifndef	_heap_h_INCLUDED
-#define	_heap_h_INCLUDED
+#ifndef	SQUID_HEAP_H
+#define	SQUID_HEAP_H
 
 /*
  * Function for generating heap keys.  The first argument will typically be
@@ -175,4 +175,4 @@
 
 extern int verify_heap_property(heap *);
 
-#endif /* _heap_h_INCLUDED */
+#endif /* SQUID_HEAP_H */
Index: squid/include/md5.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/md5.h,v
retrieving revision 1.2.28.2
retrieving revision 1.2.28.3
diff -u -r1.2.28.2 -r1.2.28.3
--- squid/include/md5.h	16 Apr 2001 11:55:38 -0000	1.2.28.2
+++ squid/include/md5.h	19 Oct 2001 19:05:08 -0000	1.2.28.3
@@ -1,9 +1,9 @@
 /*
- * $Id: md5.h,v 1.2.28.2 2001/04/16 11:55:38 rbcollins Exp $
+ * $Id: md5.h,v 1.2.28.3 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef MD5_H
-#define MD5_H
+#ifndef SQUID_MD5_H
+#define SQUID_MD5_H
 
 #if USE_OPENSSL
 
@@ -57,10 +57,11 @@
 } MD5_CTX;
 
 void MD5Init(MD5_CTX *);
-void MD5Update(MD5_CTX *, const unsigned char *, unsigned int);
-void MD5Final(unsigned char[16], MD5_CTX *);
+void MD5Update(MD5_CTX *, const void *, unsigned long);
+void MD5Final(unsigned char *, MD5_CTX *);
 
 #define MD5_DIGEST_CHARS         16
 
 #endif /* USE_OPENSSL */
-#endif /* MD5_H */
+
+#endif /* SQUID_MD5_H */
Index: squid/include/ntlmauth.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/ntlmauth.h,v
retrieving revision 1.1.22.2
retrieving revision 1.1.22.3
diff -u -r1.1.22.2 -r1.1.22.3
--- squid/include/ntlmauth.h	30 Aug 2001 17:13:11 -0000	1.1.22.2
+++ squid/include/ntlmauth.h	19 Oct 2001 19:05:08 -0000	1.1.22.3
@@ -50,8 +50,8 @@
  * It's put here as it is a common utility to all HTLM-enabled modules.
  */
 
-#ifndef _NTLMAUTH_H_
-#define _NTLMAUTH_H_
+#ifndef SQUID_NTLMAUTH_H
+#define SQUID_NTLMAUTH_H
 
 /* int*_t */
 #include "squid_types.h"
@@ -70,10 +70,10 @@
 #define bswap16(x) bswap_16(x)
 #define bswap32(x) bswap_32(x)
 #else	 /* HAVE_BISTWAP_H */
-#define bswap16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+#define bswap16(x) (((((uint16_t)x) >> 8) & 0xff) | ((((uint16_t)x) & 0xff) << 8))
 #define bswap32(x) \
-    ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) | \
-     (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
+    (((((uint32_t)x) & 0xff000000) >> 24) | ((((uint32_t)x) & 0x00ff0000) >>  8) | \
+     ((((uint32_t)x) & 0x0000ff00) <<  8) | ((((uint32_t)x) & 0x000000ff) << 24))
 #endif /* HAVE_BITSWAP_H */
 
 /* Used internally. Microsoft seems to think this is right, I believe them.
@@ -180,4 +180,4 @@
     strhdr * hdr, char *toadd,
     int toadd_length, int base_offset);
 
-#endif /* _NTLMAUTH_H_ */
+#endif /* SQUID_NTLMAUTH_H */
Index: squid/include/parse.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/parse.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/parse.h	21 May 2001 21:10:28 -0000	1.2.28.1
+++ squid/include/parse.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,9 +1,9 @@
 /*
- * $Id: parse.h,v 1.2.28.1 2001/05/21 21:10:28 serassio Exp $
+ * $Id: parse.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _HAVE_PARSE_H_
-#define _HAVE_PARSE_H_
+#ifndef SQUID_PARSE_H
+#define SQUID_PARSE_H
 
 /***********************************************************
 	Copyright 1989 by Carnegie Mellon University
@@ -90,4 +90,5 @@
 }
 
 #endif
-#endif				/* _HAVE_PARSE_H_ */
+
+#endif				/* SQUID_PARSE_H */
Index: squid/include/radix.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/radix.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/radix.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/radix.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,7 +1,10 @@
 /*
- * $Id: radix.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: radix.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
+#ifndef SQUID_RADIX_H
+#define	SQUID_RADIX_H
+
 /*
  * Copyright (c) 1988, 1989, 1993
  *      The Regents of the University of California.  All rights reserved.
@@ -37,12 +40,7 @@
  *      @(#)radix.h     8.2 (Berkeley) 10/31/94
  */
 
-#ifndef _RADIX_H_
-#define	_RADIX_H_
 #undef RN_DEBUG
-#ifndef __P
-#define __P(x) x
-#endif
 /*
  * Radix search tree node layout.
  */
@@ -115,44 +113,46 @@
     int rnh_addrsize;		/* permit, but not require fixed keys */
     int rnh_pktsize;		/* permit, but not require fixed keys */
     struct radix_node *(*rnh_addaddr)	/* add based on sockaddr */
-               __P((void *v, void *mask,
-	    struct radix_node_head * head, struct radix_node nodes[]));
+               (void *v, void *mask,
+	    struct radix_node_head * head, struct radix_node nodes[]);
     struct radix_node *(*rnh_addpkt)	/* add based on packet hdr */
-               __P((void *v, void *mask,
-	    struct radix_node_head * head, struct radix_node nodes[]));
+               (void *v, void *mask,
+	    struct radix_node_head * head, struct radix_node nodes[]);
     struct radix_node *(*rnh_deladdr)	/* remove based on sockaddr */
-               __P((void *v, void *mask, struct radix_node_head * head));
+               (void *v, void *mask, struct radix_node_head * head);
     struct radix_node *(*rnh_delpkt)	/* remove based on packet hdr */
-               __P((void *v, void *mask, struct radix_node_head * head));
+               (void *v, void *mask, struct radix_node_head * head);
     struct radix_node *(*rnh_matchaddr)		/* locate based on sockaddr */
-               __P((void *v, struct radix_node_head * head));
+               (void *v, struct radix_node_head * head);
     struct radix_node *(*rnh_lookup)	/* locate based on sockaddr */
-               __P((void *v, void *mask, struct radix_node_head * head));
+               (void *v, void *mask, struct radix_node_head * head);
     struct radix_node *(*rnh_matchpkt)	/* locate based on packet hdr */
-               __P((void *v, struct radix_node_head * head));
+               (void *v, struct radix_node_head * head);
     int (*rnh_walktree)		/* traverse tree */
-        __P((struct radix_node_head * head, int (*f) (), void *w));
+        (struct radix_node_head * head, int (*f) (struct radix_node *, void *), void *w);
     struct radix_node rnh_nodes[3];	/* empty tree for common case */
 };
 
 
 #define Bcmp(a, b, n) memcmp(((char *)(a)), ((char *)(b)), (n))
 #define Bcopy(a, b, n) memcpy(((char *)(b)), ((char *)(a)), (unsigned)(n))
-#define Bzero(p, n) memset((char *)(p),'\0', (int)(n));
+#define Bzero(p, n) memset((char *)(p),'\0', (int)(n))
 #define R_Malloc(p, t, n) (p = (t) xmalloc((unsigned int)(n)))
-#define Free(p) xfree((char *)p);
+#define Free(p) xfree((char *)p)
 
-void rn_init __P((void));
-int rn_inithead __P((void **, int));
-int rn_refines __P((void *, void *));
-int rn_walktree __P((struct radix_node_head *, int (*)(), void *));
-struct radix_node
-          *rn_addmask __P((void *, int, int)), *rn_addroute __P((void *, void *, struct radix_node_head *,
-	struct radix_node[2])), *rn_delete __P((void *, void *, struct radix_node_head *)),
-          *rn_insert __P((void *, struct radix_node_head *, int *,
-	struct radix_node[2])), *rn_match __P((void *, struct radix_node_head *)),
-          *rn_newpair __P((void *, int, struct radix_node[2])), *rn_search __P((void *, struct radix_node *)),
-          *rn_search_m __P((void *, struct radix_node *, void *));
+extern void rn_init (void);
+extern int rn_inithead(void **, int);
+extern int rn_refines(void *, void *);
+extern int rn_walktree(struct radix_node_head *, int (*)(struct radix_node *, void *), void *);
+extern struct radix_node *rn_addmask(void *, int, int);
+extern struct radix_node *rn_addroute(void *, void *, struct radix_node_head *, struct radix_node[2]);
+extern struct radix_node *rn_delete(void *, void *, struct radix_node_head *);
+extern struct radix_node *rn_insert(void *, struct radix_node_head *, int *, struct radix_node[2]);
+extern struct radix_node *rn_match(void *, struct radix_node_head *);
+extern struct radix_node *rn_newpair(void *, int, struct radix_node[2]);
+extern struct radix_node *rn_search(void *, struct radix_node *);
+extern struct radix_node *rn_search_m(void *, struct radix_node *, void *);
 extern struct radix_node *rn_lookup(void *, void *, struct radix_node_head *);
 #define min(x,y) ((x)<(y)? (x) : (y))
-#endif /* _RADIX_H_ */
+
+#endif /* SQUID_RADIX_H */
Index: squid/include/rfc1035.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/rfc1035.h,v
retrieving revision 1.3.28.1
retrieving revision 1.3.28.2
diff -u -r1.3.28.1 -r1.3.28.2
--- squid/include/rfc1035.h	14 Mar 2001 22:17:32 -0000	1.3.28.1
+++ squid/include/rfc1035.h	19 Oct 2001 19:05:08 -0000	1.3.28.2
@@ -1,5 +1,5 @@
 /*
- * $Id: rfc1035.h,v 1.3.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: rfc1035.h,v 1.3.28.2 2001/10/19 19:05:08 serassio Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -31,8 +31,8 @@
  *  
  */
 
-#ifndef _RFC1035_H_
-#define _RFC1035_H_
+#ifndef SQUID_RFC1035_H
+#define SQUID_RFC1035_H
 
 #include "config.h"
 #if HAVE_SYS_TYPES_H
@@ -75,4 +75,4 @@
 #define RFC1035_TYPE_PTR 12
 #define RFC1035_CLASS_IN 1
 
-#endif /* ndef _RFC1035_H_ */
+#endif /* SQUID_RFC1035_H */
Index: squid/include/rfc2617.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/rfc2617.h,v
retrieving revision 1.1.16.2
retrieving revision 1.1.16.3
diff -u -r1.1.16.2 -r1.1.16.3
--- squid/include/rfc2617.h	16 Apr 2001 11:55:38 -0000	1.1.16.2
+++ squid/include/rfc2617.h	19 Oct 2001 19:05:08 -0000	1.1.16.3
@@ -47,8 +47,8 @@
  *
  */
 
-#ifndef RFC2617_H
-#define RFC2617_H
+#ifndef SQUID_RFC2617_H
+#define SQUID_RFC2617_H
 
 #define HASHLEN 16
 typedef char HASH[HASHLEN];
@@ -84,4 +84,4 @@
 
 void CvtBin(const HASHHEX Hex, HASH Bin);
 
-#endif /* RFC 2617 */
+#endif /* SQUID_RFC2617_H */
Index: squid/include/snmp-internal.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp-internal.h,v
retrieving revision 1.2.28.2
retrieving revision 1.2.28.3
diff -u -r1.2.28.2 -r1.2.28.3
--- squid/include/snmp-internal.h	21 May 2001 21:10:28 -0000	1.2.28.2
+++ squid/include/snmp-internal.h	19 Oct 2001 19:05:08 -0000	1.2.28.3
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_INTERNAL_H_
-#define _SNMP_INTERNAL_H_
+#ifndef SQUID_SNMP_INTERNAL_H
+#define SQUID_SNMP_INTERNAL_H
 
 /**********************************************************************
  *
@@ -24,7 +24,7 @@
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  * 
- * $Id: snmp-internal.h,v 1.2.28.2 2001/05/21 21:10:28 serassio Exp $
+ * $Id: snmp-internal.h,v 1.2.28.3 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -32,4 +32,4 @@
 #define SNMP_TRAP_PORT	    162
 #define SNMP_MAX_LEN	    484
 
-#endif /* _SNMP_INTERNAL_H_ */
+#endif /* SQUID_SNMP_INTERNAL_H */
Index: squid/include/snmp-mib.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp-mib.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp-mib.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp-mib.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_MIB_H_
-#define _SNMP_MIB_H_
+#ifndef SQUID_SNMP_MIB_H
+#define SQUID_SNMP_MIB_H
 
 /***************************************************************************
  *
@@ -26,7 +26,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp-mib.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp-mib.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  ***************************************************************************/
 
@@ -35,4 +35,5 @@
 #if 0
 #include <mib.h>		/* Then the function definitions */
 #endif
-#endif /* _SNMP_MIB_H_ */
+
+#endif /* SQUID_SNMP_MIB_H */
Index: squid/include/snmp.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,5 +1,5 @@
-#ifndef _SNMP_H_
-#define _SNMP_H_
+#ifndef SQUID_SNMP_H
+#define SQUID_SNMP_H
 
 /*
  * Definitions for the Simple Network Management Protocol (RFC 1067).
@@ -27,7 +27,7 @@
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  * 
- * $Id: snmp.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -72,4 +72,4 @@
 #include "snmp_compat.h"
 #include "snmp_debug.h"
 
-#endif /* _SNMP_H_ */
+#endif /* SQUID_SNMP_H */
Index: squid/include/snmp_api.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_api.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_api.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_api.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_api.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_api.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _SNMP_API_H_
-#define _SNMP_API_H_
+#ifndef SQUID_SNMP_API_H
+#define SQUID_SNMP_API_H
 
 #include "config.h"
 #ifdef HAVE_SYS_TIME_H
@@ -187,4 +187,5 @@
 }
 
 #endif
-#endif				/* _SNMP_API_H_ */
+
+#endif				/* SQUID_SNMP_API_H */
Index: squid/include/snmp_api_error.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_api_error.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_api_error.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_api_error.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_API_ERROR_H_
-#define _SNMP_API_ERROR_H_
+#ifndef SQUID_SNMP_API_ERROR_H
+#define SQUID_SNMP_API_ERROR_H
 
 /***************************************************************************
  *
@@ -26,7 +26,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_api_error.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_api_error.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  ***************************************************************************/
 
@@ -67,4 +67,5 @@
 }
 
 #endif
-#endif				/* _SNMP_API_ERROR_H_ */
+
+#endif				/* SQUID_SNMP_API_ERROR_H */
Index: squid/include/snmp_api_util.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_api_util.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_api_util.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_api_util.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_api_util.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_api_util.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _SNMP_API_UTIL_H_
-#define _SNMP_API_UTIL_H_
+#ifndef SQUID_SNMP_API_UTIL_H
+#define SQUID_SNMP_API_UTIL_H
 
 /***********************************************************
 	Copyright 1997 by Carnegie Mellon University
@@ -94,4 +94,5 @@
 }
 
 #endif
-#endif				/* _SNMP_API_UTIL_H_ */
+
+#endif				/* SQUID_SNMP_API_UTIL_H */
Index: squid/include/snmp_client.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_client.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/snmp_client.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/snmp_client.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_client.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: snmp_client.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _SNMP_CLIENT_H_
-#define _SNMP_CLIENT_H_
+#ifndef SQUID_SNMP_CLIENT_H
+#define SQUID_SNMP_CLIENT_H
 
 /*
  * snmp_client.h
@@ -59,6 +59,6 @@
 
 #ifdef __cplusplus
 }
-
 #endif
-#endif				/* _SNMP_CLIENT_H_ */
+
+#endif				/* SQUID_SNMP_CLIENT_H */
Index: squid/include/snmp_coexist.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_coexist.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_coexist.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_coexist.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_COEXISTANCE_H_
-#define _SNMP_COEXISTANCE_H_
+#ifndef SQUID_SNMP_COEXISTANCE_H
+#define SQUID_SNMP_COEXISTANCE_H
 
 /**********************************************************************
  *
@@ -26,7 +26,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_coexist.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_coexist.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -39,6 +39,6 @@
 
 #ifdef __cplusplus
 }
-
 #endif
-#endif				/* _SNMP_COEXISTANCE_H_ */
+
+#endif				/* SQUID_SNMP_COEXISTANCE_H */
Index: squid/include/snmp_compat.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/Attic/snmp_compat.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_compat.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_compat.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_COMPAT_H_
-#define _SNMP_COMPAT_H_
+#ifndef SQUID_SNMP_COMPAT_H
+#define SQUID_SNMP_COMPAT_H
 
 /***************************************************************************
  *
@@ -26,7 +26,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_compat.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_compat.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  ***************************************************************************/
 
@@ -47,4 +47,4 @@
 
 #define INFORM_REQ_MSG      (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
 
-#endif /* _SNMP_COMPAT_H_ */
+#endif /* SQUID_SNMP_COMPAT_H */
Index: squid/include/snmp_debug.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_debug.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_debug.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_debug.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_debug.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_debug.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef SNMP_DEBUG_H
-#define SNMP_DEBUG_H
+#ifndef SQUID_SNMP_DEBUG_H
+#define SQUID_SNMP_DEBUG_H
 
 #if STDC_HEADERS
 extern void snmplib_debug(int, char *,...);
@@ -11,4 +11,4 @@
 extern void snmplib_debug(va_alist);
 #endif
 
-#endif
+#endif /* SQUID_SNMP_DEBUG_H */
Index: squid/include/snmp_error.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_error.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_error.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_error.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_ERROR_H_
-#define _SNMP_ERROR_H_
+#ifndef SQUID_SNMP_ERROR_H
+#define SQUID_SNMP_ERROR_H
 
 /**********************************************************************
  *
@@ -24,7 +24,7 @@
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  * 
- * $Id: snmp_error.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_error.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -63,6 +63,6 @@
 
 #ifdef __cplusplus
 }
-
 #endif
-#endif				/* _SNMP_ERROR_H_ */
+
+#endif				/* SQUID_SNMP_ERROR_H */
Index: squid/include/snmp_impl.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_impl.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_impl.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_impl.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_impl.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_impl.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _SNMP_IMPL_H_
-#define _SNMP_IMPL_H_
+#ifndef SQUID_SNMP_IMPL_H
+#define SQUID_SNMP_IMPL_H
 
 /*
  * Definitions for SNMP (RFC 1067) implementation.
@@ -97,4 +97,4 @@
 /* from snmp.c */
 extern u_char sid[];		/* size SID_MAX_LEN */
 
-#endif /* _SNMP_IMPL_H_ */
+#endif /* SQUID_SNMP_IMPL_H */
Index: squid/include/snmp_msg.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_msg.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_msg.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_msg.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_MSG_H_
-#define _SNMP_MSG_H_
+#ifndef SQUID_SNMP_MSG_H
+#define SQUID_SNMP_MSG_H
 
 /**********************************************************************
  *
@@ -26,7 +26,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_msg.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_msg.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -46,4 +46,5 @@
 }
 
 #endif
-#endif				/* _SNMP_MSG_H_ */
+
+#endif	/* SQUID_SNMP_MSG_H */
Index: squid/include/snmp_pdu.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_pdu.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/snmp_pdu.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/snmp_pdu.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,5 +1,5 @@
-#ifndef _SNMP_PDU_H_
-#define _SNMP_PDU_H_
+#ifndef SQUID_SNMP_PDU_H
+#define SQUID_SNMP_PDU_H
 
 /**********************************************************************
  *
@@ -25,7 +25,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_pdu.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: snmp_pdu.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -103,4 +103,5 @@
 #define SNMP_TRAP_AUTHENTICATIONFAILURE (0x4)
 #define SNMP_TRAP_EGPNEIGHBORLOSS       (0x5)
 #define SNMP_TRAP_ENTERPRISESPECIFIC    (0x6)
-#endif /* _SNMP_PDU_H_ */
+
+#endif /* SQUID_SNMP_PDU_H */
Index: squid/include/snmp_session.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_session.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/snmp_session.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/snmp_session.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
-#ifndef _SNMP_SESSION_H_
-#define _SNMP_SESSION_H_
+#ifndef SQUID_SNMP_SESSION_H
+#define SQUID_SNMP_SESSION_H
 
 /**********************************************************************
  *
@@ -24,7 +24,7 @@
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  * 
- * $Id: snmp_session.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: snmp_session.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -51,4 +51,4 @@
 #define RECEIVED_MESSAGE   1
 #define TIMED_OUT	   2
 
-#endif /* _SNMP_SESSION_H_ */
+#endif /* SQUID_SNMP_SESSION_H */
Index: squid/include/snmp_util.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_util.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/snmp_util.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/snmp_util.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,9 +1,9 @@
 /*
- * $Id: snmp_util.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: snmp_util.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef SNMP_UTIL_H
-#define SNMP_UTIL_H
+#ifndef SQUID_SNMP_UTIL_H
+#define SQUID_SNMP_UTIL_H
 
 /* call a function at regular intervals (in seconds): */
 extern void snmp_alarm(int ival, void (*handler) (void));
@@ -46,4 +46,4 @@
 int Util_file_write(char *file, int offset, char *data, int dataSz);
 
 /* ---------------------------------------------------------------------- */
-#endif
+#endif /* SQUID_SNMP_UTIL_H */
Index: squid/include/snmp_vars.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snmp_vars.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/snmp_vars.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/snmp_vars.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,5 +1,5 @@
-#ifndef _SNMP_VARS_H_
-#define _SNMP_VARS_H_
+#ifndef SQUID_SNMP_VARS_H
+#define SQUID_SNMP_VARS_H
 
 /**********************************************************************
  *
@@ -25,7 +25,7 @@
  * 
  * Author: Ryan Troll <ryan+@andrew.cmu.edu>
  * 
- * $Id: snmp_vars.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: snmp_vars.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  * 
  **********************************************************************/
 
@@ -73,4 +73,4 @@
 typedef struct variable variable;
 typedef struct variable_list variable_list;
 
-#endif /* _SNMP_VARS_H_ */
+#endif /* SQUID_SNMP_VARS_H */
Index: squid/include/snprintf.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/snprintf.h,v
retrieving revision 1.2.28.1
retrieving revision 1.2.28.2
diff -u -r1.2.28.1 -r1.2.28.2
--- squid/include/snprintf.h	14 Mar 2001 22:17:32 -0000	1.2.28.1
+++ squid/include/snprintf.h	19 Oct 2001 19:05:08 -0000	1.2.28.2
@@ -1,7 +1,10 @@
 /*
- * $Id: snprintf.h,v 1.2.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: snprintf.h,v 1.2.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
+#ifndef SQUID_SNPRINTF_H
+#define SQUID_SNPRINTF_H
+
 /* if you have configure you can use this */
 #if defined(HAVE_CONFIG_H)
 #include "config.h"
@@ -47,3 +50,5 @@
 int vsnprintf();
 #endif
 #endif
+
+#endif /* SQUID_SNPRINTF_H */
Index: squid/include/splay.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/splay.h,v
retrieving revision 1.3.28.1
retrieving revision 1.3.28.2
diff -u -r1.3.28.1 -r1.3.28.2
--- squid/include/splay.h	14 Mar 2001 22:17:32 -0000	1.3.28.1
+++ squid/include/splay.h	19 Oct 2001 19:05:08 -0000	1.3.28.2
@@ -1,9 +1,9 @@
 /*
- * $Id: splay.h,v 1.3.28.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: splay.h,v 1.3.28.2 2001/10/19 19:05:08 serassio Exp $
  */
 
-#ifndef _SPLAY_H
-#define _SPLAY_H
+#ifndef SQUID_SPLAY_H
+#define SQUID_SPLAY_H
 
 typedef struct _splay_node {
     void *data;
@@ -22,4 +22,4 @@
 extern void splay_destroy(splayNode *, SPLAYFREE *);
 extern void splay_walk(splayNode *, SPLAYWALKEE *, void *);
 
-#endif /* _SPLAY_H */
+#endif /* SQUID_SPLAY_H */
Index: squid/include/squid_types.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/squid_types.h,v
retrieving revision 1.1.18.1
retrieving revision 1.1.18.2
diff -u -r1.1.18.1 -r1.1.18.2
--- squid/include/squid_types.h	14 Mar 2001 22:17:32 -0000	1.1.18.1
+++ squid/include/squid_types.h	19 Oct 2001 19:05:08 -0000	1.1.18.2
@@ -50,8 +50,8 @@
  * header to include which takes care of proper preprocessor stuff
  */
 
-#ifndef _SQUID_TYPES_H_
-#define _SQUID_TYPES_H_
+#ifndef SQUID_TYPES_H
+#define SQUID_TYPES_H
 
 #include "autoconf.h"
 
@@ -72,4 +72,4 @@
 #endif
 #endif /* HAVE_GLIB_H */
 
-#endif /* _SQUID_TYPES_H_ */
+#endif /* SQUID_TYPES_H */
Index: squid/include/tempnam.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/tempnam.h,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -r1.2 -r1.2.28.1
--- squid/include/tempnam.h	23 Oct 2000 15:04:18 -0000	1.2
+++ squid/include/tempnam.h	19 Oct 2001 19:05:08 -0000	1.2.28.1
@@ -1,5 +1,5 @@
 /*
- * $Id: tempnam.h,v 1.2 2000/10/23 15:04:18 hno Exp $
+ * $Id: tempnam.h,v 1.2.28.1 2001/10/19 19:05:08 serassio Exp $
  */
 
 
@@ -20,7 +20,7 @@
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  * Cambridge, MA 02139, USA.  */
 
-#ifndef _TEMPNAM_H
-#define _TEMPNAM_H
+#ifndef SQUID_TEMPNAM_H
+#define SQUID_TEMPNAM_H
 extern char *tempnam(const char *, const char *);
-#endif /* _TEMPNAM_H */
+#endif /* SQUID_TEMPNAM_H */
Index: squid/include/util.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/include/util.h,v
retrieving revision 1.4.20.2
retrieving revision 1.4.20.3
diff -u -r1.4.20.2 -r1.4.20.3
--- squid/include/util.h	3 Jul 2001 22:04:35 -0000	1.4.20.2
+++ squid/include/util.h	19 Oct 2001 19:05:08 -0000	1.4.20.3
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.4.20.2 2001/07/03 22:04:35 serassio Exp $
+ * $Id: util.h,v 1.4.20.3 2001/10/19 19:05:08 serassio Exp $
  *
  * AUTHOR: Harvest Derived
  *
@@ -31,8 +31,8 @@
  *  
  */
 
-#ifndef _UTIL_H_
-#define _UTIL_H_
+#ifndef SQUID_UTIL_H
+#define SQUID_UTIL_H
 
 #include "config.h"
 #include <stdio.h>
@@ -75,7 +75,7 @@
 extern char *xstrncpy(char *, const char *, size_t);
 extern size_t xcountws(const char *str);
 extern time_t parse_rfc1123(const char *str);
-extern void *xcalloc(int, size_t);
+extern void *xcalloc(size_t, size_t);
 extern void *xmalloc(size_t);
 extern void *xrealloc(void *, size_t);
 extern void Tolower(char *);
@@ -132,4 +132,4 @@
  */
 int statMemoryAccounted(void);
 
-#endif /* ndef _UTIL_H_ */
+#endif /* SQUID_UTIL_H */
Index: squid/lib/md5.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/md5.c,v
retrieving revision 1.2.28.2
retrieving revision 1.2.28.3
diff -u -r1.2.28.2 -r1.2.28.3
--- squid/lib/md5.c	16 Apr 2001 11:55:38 -0000	1.2.28.2
+++ squid/lib/md5.c	19 Oct 2001 19:05:09 -0000	1.2.28.3
@@ -1,5 +1,5 @@
 /*
- * $Id: md5.c,v 1.2.28.2 2001/04/16 11:55:38 rbcollins Exp $
+ * $Id: md5.c,v 1.2.28.3 2001/10/19 19:05:09 serassio Exp $
  */
 
 /* taken from RFC-1321/Appendix A.3 */
@@ -146,9 +146,10 @@
  * processing another message block, and updating the context.
  */
 void
-MD5Update(MD5_CTX * context, const unsigned char *input, unsigned int inputLen)
+MD5Update(MD5_CTX * context, const void *input_p, unsigned long inputLen)
 {
     unsigned int i, index, partLen;
+    const unsigned char *input = input_p;
 
     /* Compute number of bytes mod 64 */
     index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
@@ -184,7 +185,7 @@
  * message digest and zeroizing the context.
  */
 void
-MD5Final(unsigned char digest[16], MD5_CTX * context)
+MD5Final(unsigned char *digest, MD5_CTX * context)
 {
     unsigned char bits[8];
     unsigned int index, padLen;
Index: squid/lib/ntlmauth.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/ntlmauth.c,v
retrieving revision 1.1.22.2
retrieving revision 1.1.22.3
diff -u -r1.1.22.2 -r1.1.22.3
--- squid/lib/ntlmauth.c	30 Aug 2001 17:13:11 -0000	1.1.22.2
+++ squid/lib/ntlmauth.c	19 Oct 2001 19:05:09 -0000	1.1.22.3
@@ -24,6 +24,13 @@
 #include "ntlmauth.h"
 #include "util.h"		/* for base64-related stuff */
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
 #if UNUSED_CODE
 /* Dumps NTLM flags to standard error for debugging purposes */
 void
@@ -51,6 +58,7 @@
 	(flags & REQUEST_NON_NT_SESSION_KEY ? "Req_nonnt_sesskey " : "")
 	);
 }
+
 #endif
 
 #define lstring_zero(s) s.str=NULL; s.l=-1;
Index: squid/lib/radix.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/radix.c,v
retrieving revision 1.3.28.2
retrieving revision 1.3.28.3
diff -u -r1.3.28.2 -r1.3.28.3
--- squid/lib/radix.c	12 Aug 2001 16:15:02 -0000	1.3.28.2
+++ squid/lib/radix.c	19 Oct 2001 19:05:09 -0000	1.3.28.3
@@ -1,5 +1,5 @@
 /*
- * $Id: radix.c,v 1.3.28.2 2001/08/12 16:15:02 serassio Exp $
+ * $Id: radix.c,v 1.3.28.3 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 53     Radix tree data structure implementation
  * AUTHOR: NetBSD Derived
@@ -159,9 +159,7 @@
  */
 
 struct radix_node *
-rn_search(v_arg, head)
-     void *v_arg;
-     struct radix_node *head;
+rn_search(void *v_arg, struct radix_node *head)
 {
     register struct radix_node *x;
     register caddr_t v;
@@ -176,9 +174,7 @@
 }
 
 struct radix_node *
-rn_search_m(v_arg, head, m_arg)
-     struct radix_node *head;
-     void *v_arg, *m_arg;
+rn_search_m(void *v_arg, struct radix_node *head, void *m_arg)
 {
     register struct radix_node *x;
     register caddr_t v = v_arg, m = m_arg;
@@ -194,8 +190,7 @@
 }
 
 int
-rn_refines(m_arg, n_arg)
-     void *m_arg, *n_arg;
+rn_refines(void *m_arg, void *n_arg)
 {
     register caddr_t m = m_arg, n = n_arg;
     register caddr_t lim, lim2 = lim = n + *(u_char *) n;
@@ -221,9 +216,7 @@
 }
 
 struct radix_node *
-rn_lookup(v_arg, m_arg, head)
-     void *v_arg, *m_arg;
-     struct radix_node_head *head;
+rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
 {
     register struct radix_node *x;
     caddr_t netmask = 0;
@@ -241,12 +234,8 @@
     return x;
 }
 
-static
-int
-rn_satsifies_leaf(trial, leaf, skip)
-     char *trial;
-     register struct radix_node *leaf;
-     int skip;
+static int
+rn_satsifies_leaf (char *trial, register struct radix_node *leaf, int skip)
 {
     register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
     char *cplim;
@@ -266,9 +255,7 @@
 }
 
 struct radix_node *
-rn_match(v_arg, head)
-     void *v_arg;
-     struct radix_node_head *head;
+rn_match(void *v_arg, struct radix_node_head *head)
 {
     caddr_t v = v_arg;
     register struct radix_node *t = head->rnh_treetop, *x;
@@ -375,10 +362,7 @@
 #endif
 
 struct radix_node *
-rn_newpair(v, b, nodes)
-     void *v;
-     int b;
-     struct radix_node nodes[2];
+rn_newpair(void *v, int b, struct radix_node nodes[2])
 {
     register struct radix_node *tt = nodes, *t = tt + 1;
     t->rn_b = b;
@@ -400,11 +384,7 @@
 }
 
 struct radix_node *
-rn_insert(v_arg, head, dupentry, nodes)
-     void *v_arg;
-     struct radix_node_head *head;
-     int *dupentry;
-     struct radix_node nodes[2];
+rn_insert(void *v_arg, struct radix_node_head *head, int *dupentry, struct radix_node nodes[2])
 {
     caddr_t v = v_arg;
     struct radix_node *top = head->rnh_treetop;
@@ -470,9 +450,7 @@
 }
 
 struct radix_node *
-rn_addmask(n_arg, search, skip)
-     int search, skip;
-     void *n_arg;
+rn_addmask(void *n_arg, int search, int skip)
 {
     caddr_t netmask = (caddr_t) n_arg;
     register struct radix_node *x;
@@ -544,8 +522,7 @@
 }
 
 static int			/* XXX: arbitrary ordering for non-contiguous masks */
-rn_lexobetter(m_arg, n_arg)
-     void *m_arg, *n_arg;
+rn_lexobetter(void *m_arg, void *n_arg)
 {
     register u_char *mp = m_arg, *np = n_arg, *lim;
 
@@ -559,9 +536,7 @@
 }
 
 static struct radix_mask *
-rn_new_radix_mask(tt, next)
-     register struct radix_node *tt;
-     register struct radix_mask *next;
+rn_new_radix_mask(struct radix_node *tt, struct radix_mask *next)
 {
     register struct radix_mask *m;
 
@@ -583,10 +558,7 @@
 }
 
 struct radix_node *
-rn_addroute(v_arg, n_arg, head, treenodes)
-     void *v_arg, *n_arg;
-     struct radix_node_head *head;
-     struct radix_node treenodes[2];
+rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, struct radix_node treenodes[2])
 {
     caddr_t v = (caddr_t) v_arg, netmask = (caddr_t) n_arg;
     register struct radix_node *t, *x = NULL, *tt;
@@ -738,9 +710,7 @@
 }
 
 struct radix_node *
-rn_delete(v_arg, netmask_arg, head)
-     void *v_arg, *netmask_arg;
-     struct radix_node_head *head;
+rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head)
 {
     register struct radix_node *t, *p, *x, *tt;
     struct radix_mask *m, *saved_m, **mp;
@@ -920,10 +890,7 @@
 }
 
 int
-rn_walktree(h, f, w)
-     struct radix_node_head *h;
-     int (*f) ();
-     void *w;
+rn_walktree(struct radix_node_head *h, int (*f)(struct radix_node *, void *), void *w)
 {
     int error;
     struct radix_node *base, *next;
@@ -959,9 +926,7 @@
 }
 
 int
-rn_inithead(head, off)
-     void **head;
-     int off;
+rn_inithead(void **head, int off)
 {
     register struct radix_node_head *rnh;
     register struct radix_node *t, *tt, *ttt;
@@ -991,7 +956,7 @@
 }
 
 void
-rn_init()
+rn_init(void)
 {
     char *cp, *cplim;
 #ifdef KERNEL
Index: squid/lib/rfc1035.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/rfc1035.c,v
retrieving revision 1.4.26.1
retrieving revision 1.4.26.2
diff -u -r1.4.26.1 -r1.4.26.2
--- squid/lib/rfc1035.c	14 Mar 2001 22:17:32 -0000	1.4.26.1
+++ squid/lib/rfc1035.c	19 Oct 2001 19:05:09 -0000	1.4.26.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1035.c,v 1.4.26.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: rfc1035.c,v 1.4.26.2 2001/10/19 19:05:09 serassio Exp $
  *
  * Low level DNS protocol routines
  * AUTHOR: Duane Wessels
@@ -464,7 +464,10 @@
 	    break;
 	nr++;
     }
-    *records = recs;
+    if (nr > 0)
+	*records = recs;
+    else
+	free(recs);
     return nr;
 }
 
Index: squid/lib/rfc2617.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/rfc2617.c,v
retrieving revision 1.1.16.2
retrieving revision 1.1.16.3
diff -u -r1.1.16.2 -r1.1.16.3
--- squid/lib/rfc2617.c	16 Apr 2001 11:55:38 -0000	1.1.16.2
+++ squid/lib/rfc2617.c	19 Oct 2001 19:05:09 -0000	1.1.16.3
@@ -51,7 +51,7 @@
 #include "rfc2617.h"
 #include "md5.h"
 
-void 
+void
 CvtHex(const HASH Bin, HASHHEX Hex)
 {
     unsigned short i;
@@ -68,11 +68,11 @@
 	    Hex[i * 2 + 1] = (j + '0');
 	else
 	    Hex[i * 2 + 1] = (j + 'a' - 10);
-    };
+    }
     Hex[HASHHEXLEN] = '\0';
-};
+}
 
-void 
+void
 CvtBin(const HASHHEX Hex, HASH Bin)
 {
     unsigned short i;
@@ -84,13 +84,13 @@
 	    Bin[i / 2] |= ((j - '0') << ((i % 2 == 0) ? 4 : 0));
 	else
 	    Bin[i / 2] |= ((j - 'a' + 10) << ((i % 2 == 0) ? 4 : 0));
-    };
+    }
     Bin[HASHLEN] = '\0';
-};
+}
 
 
 /* calculate H(A1) as per spec */
-void 
+void
 DigestCalcHA1(
     const char *pszAlg,
     const char *pszUserName,
@@ -111,7 +111,7 @@
 	MD5Update(&Md5Ctx, pszRealm, strlen(pszRealm));
 	MD5Update(&Md5Ctx, ":", 1);
 	MD5Update(&Md5Ctx, pszPassword, strlen(pszPassword));
-	MD5Final(HA1, &Md5Ctx);
+	MD5Final((unsigned char *)HA1, &Md5Ctx);
     }
     if (strcasecmp(pszAlg, "md5-sess") == 0) {
 	MD5Init(&Md5Ctx);
@@ -120,13 +120,13 @@
 	MD5Update(&Md5Ctx, pszNonce, strlen(pszNonce));
 	MD5Update(&Md5Ctx, ":", 1);
 	MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce));
-	MD5Final(HA1, &Md5Ctx);
-    };
+	MD5Final((unsigned char *)HA1, &Md5Ctx);
+    }
     CvtHex(HA1, SessionKey);
-};
+}
 
 /* calculate request-digest/response-digest as per HTTP Digest spec */
-void 
+void
 DigestCalcResponse(
     const HASHHEX HA1,		/* H(A1) */
     const char *pszNonce,	/* nonce from server */
@@ -153,8 +153,8 @@
     if (strcasecmp(pszQop, "auth-int") == 0) {
 	MD5Update(&Md5Ctx, ":", 1);
 	MD5Update(&Md5Ctx, HEntity, HASHHEXLEN);
-    };
-    MD5Final(HA2, &Md5Ctx);
+    }
+    MD5Final((unsigned char *)HA2, &Md5Ctx);
     CvtHex(HA2, HA2Hex);
 
     /* calculate response
@@ -171,8 +171,8 @@
 	MD5Update(&Md5Ctx, ":", 1);
 	MD5Update(&Md5Ctx, pszQop, strlen(pszQop));
 	MD5Update(&Md5Ctx, ":", 1);
-    };
+    }
     MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN);
-    MD5Final(RespHash, &Md5Ctx);
+    MD5Final((unsigned char *)RespHash, &Md5Ctx);
     CvtHex(RespHash, Response);
-};
+}
Index: squid/lib/util.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/lib/util.c,v
retrieving revision 1.4.14.3
retrieving revision 1.4.14.4
diff -u -r1.4.14.3 -r1.4.14.4
--- squid/lib/util.c	3 Jul 2001 22:04:35 -0000	1.4.14.3
+++ squid/lib/util.c	19 Oct 2001 19:05:09 -0000	1.4.14.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: util.c,v 1.4.14.3 2001/07/03 22:04:35 serassio Exp $
+ * $Id: util.c,v 1.4.14.4 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -489,7 +489,7 @@
 void
 xxfree(const void *s_const)
 {
-    void *s = (void *)s_const;
+    void *s = (void *) s_const;
 #if XMALLOC_TRACE
     xmalloc_show_trace(s, -1);
 #endif
@@ -553,7 +553,7 @@
  *  Never returns NULL; fatal on error.
  */
 void *
-xcalloc(int n, size_t sz)
+xcalloc(size_t n, size_t sz)
 {
     void *p;
 
@@ -563,8 +563,8 @@
 	sz = 1;
     if ((p = calloc(n, sz)) == NULL) {
 	if (failure_notify) {
-	    snprintf(msg, 128, "xcalloc: Unable to allocate %d blocks of %d bytes!\n",
-		(int) n, (int) sz);
+	    snprintf(msg, 128, "xcalloc: Unable to allocate %u blocks of %u bytes!\n",
+		(unsigned int) n, (unsigned int) sz);
 	    (*failure_notify) (msg);
 	} else {
 	    perror("xcalloc");
@@ -582,7 +582,7 @@
 #endif
 #if MEM_GEN_TRACE
     if (tracefp)
-	fprintf(tracefp, "c:%d:%d:%p\n", n, sz, p);
+	fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int) n, (unsigned int) sz, p);
 #endif
     return (p);
 }
Index: squid/src/.cvsignore
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.3.12.1
diff -u -r1.3 -r1.3.12.1
--- squid/src/.cvsignore	11 Oct 2001 12:23:40 -0000	1.3
+++ squid/src/.cvsignore	19 Oct 2001 19:05:09 -0000	1.3.12.1
@@ -1,2 +1,5 @@
 .cvsignore
 Makefile.in
+cache_manager-reconfigure.c
+service
+dns
Index: squid/src/HttpHeader.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/HttpHeader.c,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -r1.4.2.2 -r1.4.2.3
--- squid/src/HttpHeader.c	16 Apr 2001 11:55:38 -0000	1.4.2.2
+++ squid/src/HttpHeader.c	19 Oct 2001 19:05:09 -0000	1.4.2.3
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.c,v 1.4.2.2 2001/04/16 11:55:38 rbcollins Exp $
+ * $Id: HttpHeader.c,v 1.4.2.3 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -408,7 +408,8 @@
 		field_ptr++;
 	    if (*field_ptr == '\n')
 		field_ptr++;
-	} while (*field_ptr == ' ' || *field_ptr == '\t');
+	}
+	while (*field_ptr == ' ' || *field_ptr == '\t');
 	if (!*field_end || field_end > header_end)
 	    return httpHeaderReset(hdr);	/* missing <CRLF> */
 	e = httpHeaderEntryParseCreate(field_start, field_end);
@@ -683,12 +684,12 @@
 }
 
 void
-httpHeaderPutTime(HttpHeader * hdr, http_hdr_type id, time_t time)
+httpHeaderPutTime(HttpHeader * hdr, http_hdr_type id, time_t htime)
 {
     assert_eid(id);
     assert(Headers[id].type == ftDate_1123);	/* must be of an appropriate type */
     assert(time >= 0);
-    httpHeaderAddEntry(hdr, httpHeaderEntryCreate(id, NULL, mkrfc1123(time)));
+    httpHeaderAddEntry(hdr, httpHeaderEntryCreate(id, NULL, mkrfc1123(htime)));
 }
 
 void
@@ -701,10 +702,10 @@
 }
 
 void
-httpHeaderPutAuth(HttpHeader * hdr, const char *authScheme, const char *realm)
+httpHeaderPutAuth(HttpHeader * hdr, const char *auth_scheme, const char *realm)
 {
-    assert(hdr && authScheme && realm);
-    httpHeaderPutStrf(hdr, HDR_WWW_AUTHENTICATE, "%s realm=\"%s\"", authScheme, realm);
+    assert(hdr && auth_scheme && realm);
+    httpHeaderPutStrf(hdr, HDR_WWW_AUTHENTICATE, "%s realm=\"%s\"", auth_scheme, realm);
 }
 
 void
@@ -877,16 +878,16 @@
 }
 
 const char *
-httpHeaderGetAuth(const HttpHeader * hdr, http_hdr_type id, const char *authScheme)
+httpHeaderGetAuth(const HttpHeader * hdr, http_hdr_type id, const char *auth_scheme)
 {
     const char *field;
     int l;
-    assert(hdr && authScheme);
+    assert(hdr && auth_scheme);
     field = httpHeaderGetStr(hdr, id);
     if (!field)			/* no authorization field */
 	return NULL;
-    l = strlen(authScheme);
-    if (!l || strncasecmp(field, authScheme, l))	/* wrong scheme */
+    l = strlen(auth_scheme);
+    if (!l || strncasecmp(field, auth_scheme, l))	/* wrong scheme */
 	return NULL;
     field += l;
     if (!xisspace(*field))	/* wrong scheme */
Index: squid/src/Makefile.am
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/Makefile.am,v
retrieving revision 1.2.6.3
retrieving revision 1.2.6.4
diff -u -r1.2.6.3 -r1.2.6.4
--- squid/src/Makefile.am	30 Sep 2001 20:38:14 -0000	1.2.6.3
+++ squid/src/Makefile.am	19 Oct 2001 19:05:09 -0000	1.2.6.4
@@ -59,8 +59,6 @@
 endif
 
 SUBDIRS		= fs repl auth
-#look into pkgsbin..
-libexecdir      = ${prefix}/libexec/squid
 
 INCLUDES        = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include
 
Index: squid/src/access_log.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v
retrieving revision 1.6.4.3
retrieving revision 1.6.4.4
diff -u -r1.6.4.3 -r1.6.4.4
--- squid/src/access_log.c	25 Aug 2001 08:28:46 -0000	1.6.4.3
+++ squid/src/access_log.c	19 Oct 2001 19:05:09 -0000	1.6.4.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.c,v 1.6.4.3 2001/08/25 08:28:46 serassio Exp $
+ * $Id: access_log.c,v 1.6.4.4 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -127,7 +127,7 @@
 	*buf = '\0';
 	return buf;
     }
-    buf = xcalloc((strlen(header) * 3) + 1, 1);
+    buf = xcalloc(1, (strlen(header) * 3) + 1);
     buf_cursor = buf;
     /*
      * We escape: \x00-\x1F"#%;<>?{}|\\\\^~`\[\]\x7F-\xFF 
@@ -195,7 +195,7 @@
 	*buf = '\0';
 	return buf;
     }
-    buf = xcalloc((strlen(header) * 3) + 1, 1);
+    buf = xcalloc(1, (strlen(header) * 3) + 1);
     buf_cursor = buf;
     /*
      * We escape: space \x00-\x1F and space (0x40) and \x7F-\xFF
Index: squid/src/acl.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/acl.c,v
retrieving revision 1.6.2.9
retrieving revision 1.6.2.10
diff -u -r1.6.2.9 -r1.6.2.10
--- squid/src/acl.c	30 Sep 2001 20:38:14 -0000	1.6.2.9
+++ squid/src/acl.c	19 Oct 2001 19:05:09 -0000	1.6.2.10
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.c,v 1.6.2.9 2001/09/30 20:38:14 serassio Exp $
+ * $Id: acl.c,v 1.6.2.10 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -51,14 +51,12 @@
 static void aclParseTimeSpec(void *curlist);
 static void aclParseIntRange(void *curlist);
 static char *strtokFile(void);
-static void aclDestroyAclList(acl_list * list);
 static void aclDestroyTimeList(acl_time_data * data);
 static void aclDestroyIntRange(intrange *);
 static void aclLookupProxyAuthStart(aclCheck_t * checklist);
 static void aclLookupProxyAuthDone(void *data, char *result);
 static struct _acl *aclFindByName(const char *name);
 static int aclMatchAcl(struct _acl *, aclCheck_t *);
-static int aclMatchIntegerRange(intrange * data, int i);
 static int aclMatchTime(acl_time_data * data, time_t when);
 static int aclMatchUser(void *proxyauth_acl, char *user);
 static int aclMatchIp(void *dataptr, struct in_addr c);
@@ -966,9 +964,6 @@
     acl_access *A = NULL;
     acl_access *B = NULL;
     acl_access **T = NULL;
-    acl_list *L = NULL;
-    acl_list **Tail = NULL;
-    acl *a = NULL;
 
     /* first expect either 'allow' or 'deny' */
     if ((t = strtok(NULL, w_space)) == NULL) {
@@ -990,10 +985,31 @@
 	cbdataFree(A);
 	return;
     }
+    aclParseAclList(&A->acl_list);
+    if (A->acl_list == NULL) {
+	debug(28, 0) ("%s line %d: %s\n",
+	    cfg_filename, config_lineno, config_input_line);
+	debug(28, 0) ("aclParseAccessLine: Access line contains no ACL's, skipping\n");
+	cbdataFree(A);
+	return;
+    }
+    A->cfgline = xstrdup(config_input_line);
+    /* Append to the end of this list */
+    for (B = *head, T = head; B; T = &B->next, B = B->next);
+    *T = A;
+    /* We lock _acl_access structures in aclCheck() */
+}
+
+void
+aclParseAclList(acl_list ** head)
+{
+    acl_list *L = NULL;
+    acl_list **Tail = head;	/* sane name in the use below */
+    acl *a = NULL;
+    char *t;
 
     /* next expect a list of ACL names, possibly preceeded
      * by '!' for negation */
-    Tail = &A->acl_list;
     while ((t = strtok(NULL, w_space))) {
 	L = memAllocate(MEM_ACL_LIST);
 	L->op = 1;		/* defaults to non-negated */
@@ -1015,18 +1031,6 @@
 	*Tail = L;
 	Tail = &L->next;
     }
-    if (A->acl_list == NULL) {
-	debug(28, 0) ("%s line %d: %s\n",
-	    cfg_filename, config_lineno, config_input_line);
-	debug(28, 0) ("aclParseAccessLine: Access line contains no ACL's, skipping\n");
-	cbdataFree(A);
-	return;
-    }
-    A->cfgline = xstrdup(config_input_line);
-    /* Append to the end of this list */
-    for (B = *head, T = head; B; T = &B->next, B = B->next);
-    *T = A;
-    /* We lock _acl_access structures in aclCheck() */
 }
 
 /**************/
@@ -2101,13 +2105,13 @@
     *head = NULL;
 }
 
-static void
-aclDestroyAclList(acl_list * list)
+void
+aclDestroyAclList(acl_list ** head)
 {
-    acl_list *next = NULL;
-    for (; list; list = next) {
-	next = list->next;
-	memFree(list, MEM_ACL_LIST);
+    acl_list *l;
+    for (l = *head; l; l = *head) {
+	*head = l->next;
+	memFree(l, MEM_ACL_LIST);
     }
 }
 
@@ -2119,8 +2123,7 @@
     for (l = *list; l; l = next) {
 	debug(28, 3) ("aclDestroyAccessList: '%s'\n", l->cfgline);
 	next = l->next;
-	aclDestroyAclList(l->acl_list);
-	l->acl_list = NULL;
+	aclDestroyAclList(&l->acl_list);
 	safe_free(l->cfgline);
 	cbdataFree(l);
     }
Index: squid/src/asn.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/asn.c,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- squid/src/asn.c	14 Mar 2001 22:17:32 -0000	1.5.4.1
+++ squid/src/asn.c	19 Oct 2001 19:05:09 -0000	1.5.4.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.c,v 1.5.4.1 2001/03/14 22:17:32 rbcollins Exp $
+ * $Id: asn.c,v 1.5.4.2 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -408,7 +408,7 @@
 }
 
 static int
-mask_len(int mask)
+mask_len(u_long mask)
 {
     int len = 32;
     if (mask == 0)
Index: squid/src/authenticate.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v
retrieving revision 1.4.20.6
retrieving revision 1.4.20.7
diff -u -r1.4.20.6 -r1.4.20.7
--- squid/src/authenticate.c	30 Sep 2001 20:38:14 -0000	1.4.20.6
+++ squid/src/authenticate.c	19 Oct 2001 19:05:09 -0000	1.4.20.7
@@ -1,6 +1,6 @@
 
 /*
- * $Id: authenticate.c,v 1.4.20.6 2001/09/30 20:38:14 serassio Exp $
+ * $Id: authenticate.c,v 1.4.20.7 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -934,7 +934,7 @@
 authSchemeAdd(char *type, AUTHSSETUP * setup)
 {
     int i;
-    debug(29, 4) ("authSchemeAdd: adding %s", type);
+    debug(29, 4) ("authSchemeAdd: adding %s\n", type);
     /* find the number of currently known authscheme types */
     for (i = 0; authscheme_list && authscheme_list[i].typestr; i++) {
 	assert(strcmp(authscheme_list[i].typestr, type) != 0);
Index: squid/src/cache_cf.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v
retrieving revision 1.6.10.12
retrieving revision 1.6.10.13
diff -u -r1.6.10.12 -r1.6.10.13
--- squid/src/cache_cf.c	25 Aug 2001 08:28:46 -0000	1.6.10.12
+++ squid/src/cache_cf.c	19 Oct 2001 19:05:09 -0000	1.6.10.13
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.c,v 1.6.10.12 2001/08/25 08:28:46 serassio Exp $
+ * $Id: cache_cf.c,v 1.6.10.13 2001/10/19 19:05:09 serassio Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -563,20 +563,26 @@
 }
 
 static void
-dump_acl_access(StoreEntry * entry, const char *name, acl_access * head)
+dump_acl_list(StoreEntry * entry, acl_list * head)
 {
     acl_list *l;
-    while (head != NULL) {
+    for (l = head; l; l = l->next) {
+	storeAppendPrintf(entry, " %s%s",
+	    l->op ? null_string : "!",
+	    l->acl->name);
+    }
+}
+
+static void
+dump_acl_access(StoreEntry * entry, const char *name, acl_access * head)
+{
+    acl_access *l;
+    for (l = head; l; l = l->next) {
 	storeAppendPrintf(entry, "%s %s",
 	    name,
-	    head->allow ? "Allow" : "Deny");
-	for (l = head->acl_list; l != NULL; l = l->next) {
-	    storeAppendPrintf(entry, " %s%s",
-		l->op ? null_string : "!",
-		l->acl->name);
-	}
+	    l->allow ? "Allow" : "Deny");
+	dump_acl_list(entry, l->acl_list);
 	storeAppendPrintf(entry, "\n");
-	head = head->next;
     }
 }
 
@@ -620,6 +626,110 @@
     memset(addr, '\0', sizeof(struct in_addr));
 }
 
+CBDATA_TYPE(acl_address);
+
+static void
+dump_acl_address(StoreEntry * entry, const char *name, acl_address * head)
+{
+    acl_address *l;
+    for (l = head; l; l = l->next) {
+	if (l->addr.s_addr != INADDR_ANY)
+	    storeAppendPrintf(entry, "%s %s", name, inet_ntoa(l->addr));
+	else
+	    storeAppendPrintf(entry, "%s autoselect", name);
+	dump_acl_list(entry, l->acl_list);
+	storeAppendPrintf(entry, "\n");
+    }
+}
+
+static void
+freed_acl_address(void *data)
+{
+    acl_address *l = data;
+    aclDestroyAclList(&l->acl_list);
+}
+
+static void
+parse_acl_address(acl_address ** head)
+{
+    acl_address *l;
+    acl_address **tail = head;	/* sane name below */
+    CBDATA_INIT_TYPE_FREECB(acl_address, freed_acl_address);
+    l = cbdataAlloc(acl_address);
+    parse_address(&l->addr);
+    aclParseAclList(&l->acl_list);
+    while (*tail)
+	tail = &(*tail)->next;
+    *tail = l;
+}
+
+static void
+free_acl_address(acl_address ** head)
+{
+    while (*head) {
+	acl_address *l = *head;
+	*head = l->next;
+	cbdataFree(l);
+    }
+}
+
+CBDATA_TYPE(acl_tos);
+
+static void
+dump_acl_tos(StoreEntry * entry, const char *name, acl_tos * head)
+{
+    acl_tos *l;
+    for (l = head; l; l = l->next) {
+	if (l->tos > 0)
+	    storeAppendPrintf(entry, "%s 0x%02X", name, l->tos);
+	else
+	    storeAppendPrintf(entry, "%s none", name);
+	dump_acl_list(entry, l->acl_list);
+	storeAppendPrintf(entry, "\n");
+    }
+}
+
+static void
+freed_acl_tos(void *data)
+{
+    acl_tos *l = data;
+    aclDestroyAclList(&l->acl_list);
+}
+
+static void
+parse_acl_tos(acl_tos ** head)
+{
+    acl_tos *l;
+    acl_tos **tail = head;	/* sane name below */
+    int tos;
+    char junk;
+    char *token = strtok(NULL, w_space);
+    if (!token)
+	self_destruct();
+    if (sscanf(token, "0x%x%c", &tos, &junk) != 1)
+	self_destruct();
+    if (tos < 0 || tos > 255)
+	self_destruct();
+    CBDATA_INIT_TYPE_FREECB(acl_tos, freed_acl_tos);
+    l = cbdataAlloc(acl_tos);
+    l->tos = tos;
+    aclParseAclList(&l->acl_list);
+    while (*tail)
+	tail = &(*tail)->next;
+    *tail = l;
+}
+
+static void
+free_acl_tos(acl_tos ** head)
+{
+    while (*head) {
+	acl_tos *l = *head;
+	*head = l->next;
+	l->next = NULL;
+	cbdataFree(l);
+    }
+}
+
 #if DELAY_POOLS
 
 /* do nothing - free_delay_pool_count is the magic free function.
@@ -1809,7 +1919,7 @@
 void
 parse_eol(char *volatile *var)
 {
-    unsigned char *token = strtok(NULL, null_string);
+    unsigned char *token = (unsigned char *) strtok(NULL, null_string);
     safe_free(*var);
     if (token == NULL)
 	self_destruct();
@@ -1817,7 +1927,7 @@
 	token++;
     if (!*token)
 	self_destruct();
-    *var = xstrdup(token);
+    *var = xstrdup((char *) token);
 }
 
 static void
@@ -1908,8 +2018,8 @@
 }
 
 static void
-free_body_size_t(dlink_list * bodylist)		//acl_access ** head)
- {
+free_body_size_t(dlink_list * bodylist)
+{
     body_size *bs, *tempnode;
     bs = (body_size *) bodylist->head;
     while (bs) {
Index: squid/src/cf.data.pre
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v
retrieving revision 1.10.2.13
retrieving revision 1.10.2.14
diff -u -r1.10.2.13 -r1.10.2.14
--- squid/src/cf.data.pre	4 Oct 2001 19:50:28 -0000	1.10.2.13
+++ squid/src/cf.data.pre	19 Oct 2001 19:05:09 -0000	1.10.2.14
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.10.2.13 2001/10/04 19:50:28 serassio Exp $
+# $Id: cf.data.pre,v 1.10.2.14 2001/10/19 19:05:09 serassio Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -94,7 +94,7 @@
 
         The socket address where Squid will listen for HTTPS client
         requests.
-	
+
         This is really only useful for situations where you are running
         squid in accelerator mode and you want to do the SSL work at the
         accelerator level.
@@ -173,12 +173,6 @@
 DOC_END
 
 
-NAME: tcp_outgoing_address outbound_address
-TYPE: address
-LOC: Config.Addrs.tcp_outgoing
-DEFAULT: 255.255.255.255
-DOC_NONE
-
 NAME: udp_incoming_address
 TYPE: address
 LOC:Config.Addrs.udp_incoming
@@ -193,8 +187,6 @@
 	Usage: tcp_incoming_address 10.20.30.40
 	       udp_outgoing_address fully.qualified.domain.name
 
-	tcp_outgoing_address	is used for connections made to remote
-				servers and other caches.
 	udp_incoming_address	is used for the ICP socket receiving packets
 				from other caches.
 	udp_outgoing_address	is used for ICP packets sent out to other
@@ -1574,25 +1566,32 @@
 DEFAULT: 95
 LOC: Config.quickAbort.pct
 DOC_START
-	The cache can be configured to continue downloading aborted
-	requests.  This may be undesirable on slow (e.g. SLIP) links
-	and/or very busy caches.  Impatient users may tie up file
-	descriptors and bandwidth by repeatedly requesting and
-	immediately aborting downloads.
+	The cache by default continues downloading aborted requests
+	which are almost completed (less than 16 KB remaining). This
+	may be undesirable on slow (e.g. SLIP) links and/or very busy
+	caches.  Impatient users may tie up file descriptors and
+	bandwidth by repeatedly requesting and immediately aborting
+	downloads.
 
 	When the user aborts a request, Squid will check the
 	quick_abort values to the amount of data transfered until
 	then.
 
 	If the transfer has less than 'quick_abort_min' KB remaining,
-	it will finish the retrieval.  Setting 'quick_abort_min' to -1
-	will disable the quick_abort feature.
+	it will finish the retrieval.
 
 	If the transfer has more than 'quick_abort_max' KB remaining,
 	it will abort the retrieval.
 
 	If more than 'quick_abort_pct' of the transfer has completed,
 	it will finish the retrieval.
+
+	If you do not want any retrieval to continue after the client
+	has aborted, set both 'quick_abort_min' and 'quick_abort_max'
+	to '0 KB'.
+
+	If you want retrievals to always continue if they are being
+	cached then set 'quick_abort_min' to '-1 KB'.
 DOC_END
 
 
@@ -2099,6 +2098,60 @@
 	the configure script.
 DOC_END
 
+NAME: tcp_outgoing_tos tcp_outgoing_ds tcp_outgoin_dscp
+TYPE: acl_tos
+DEFAULT: none
+LOC: Config.accessList.outgoing_tos
+DOC_START
+	Allows you to select a TOS/Diffserv value to mark outgoing
+	connections with, based on the username or source address
+	making the request.
+
+	tcp_outgoing_tos ds-field [!]aclname ...
+
+	Example where normal_service_net uses the TOS value 0x00
+	and normal_service_net uses 0x20
+
+	acl normal_service_net src 10.0.0.0/255.255.255.0
+	acl good_service_net src 10.0.1.0/255.255.255.0
+	tcp_outgoing_tos 0x00 normal_service_net 0x00
+	tcp_outgoing_tos 0x20 good_service_net
+
+	TOS/DSCP values really only have local significance - so you should
+	know what you're specifying. For more, see RFC 2474
+
+	The TOS/DSCP byte must be exactly that - a byte, value  0 - 255, or
+	"default" to use whatever default your host has.
+
+	Processing proceeds in the order specified, and stops at first fully
+	matching line.
+DOC_END
+
+NAME: tcp_outgoing_address
+TYPE: acl_address
+DEFAULT: none
+LOC: Config.accessList.outgoing_address
+DOC_START
+	Allows you to map requests to different outgoing IP addresses
+	based on the username or sourceaddress of the user making
+	the request.
+	
+	tcp_outgoing_address ipaddr [[!]aclname] ...
+
+	Example where requests from 10.0.0.0/24 will be forwareded
+	with source address 10.1.0.1, 10.0.2.0/24 forwarded with 
+	source address 10.1.0.2 and the rest will be forwarded with
+	source address 10.1.0.3.
+
+	acl normal_service_net src 10.0.0.0/255.255.255.0
+	acl good_service_net src 10.0.1.0/255.255.255.0
+	tcp_outgoing_address 10.0.0.1 normal_service_net
+	tcp_outgoing_address 10.0.0.2 good_service_net
+	tcp_outgoing_address 10.0.0.3
+
+	Processing proceeds in the order specified, and stops at first fully
+	matching line.
+DOC_END
 
 NAME: reply_body_max_size
 COMMENT: bytes allow|deny acl acl...
@@ -2402,6 +2455,10 @@
 	Appends local domain name to hostnames without any dots in
 	them.  append_domain must begin with a period.
 
+	Be warned that there today is Internet names with no dots in
+	them using only top-domain names, so setting this may
+	cause some Internet sites to become unavailable.
+
 Example:
  append_domain .yourdomain.com
 DOC_END
Index: squid/src/comm.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/comm.c,v
retrieving revision 1.4.20.4
retrieving revision 1.4.20.5
diff -u -r1.4.20.4 -r1.4.20.5
--- squid/src/comm.c	27 Aug 2001 19:25:57 -0000	1.4.20.4
+++ squid/src/comm.c	19 Oct 2001 19:05:10 -0000	1.4.20.5
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.c,v 1.4.20.4 2001/08/27 19:25:57 serassio Exp $
+ * $Id: comm.c,v 1.4.20.5 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -148,7 +148,7 @@
 }
 
 /* Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
- * is OR of flags specified in comm.h. */
+ * is OR of flags specified in comm.h. Defaults TOS */
 int
 comm_open(int sock_type,
     int proto,
@@ -157,7 +157,23 @@
     int flags,
     const char *note)
 {
+    return comm_openex(sock_type, proto, addr, port, flags, 0, note);
+}
+
+
+/* Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
+ * is OR of flags specified in defines.h:COMM_* */
+int
+comm_openex(int sock_type,
+    int proto,
+    struct in_addr addr,
+    u_short port,
+    int flags,
+    unsigned char TOS,
+    const char *note)
+{
     int new_socket;
+    int tos;
     fde *F = NULL;
 
     /* Create socket for accepting new connections. */
@@ -177,10 +193,23 @@
 	}
 	return -1;
     }
+    /* set TOS if needed */
+    if (TOS) {
+#ifdef IP_TOS
+	tos = TOS;
+	if (setsockopt(new_socket, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(int)) < 0)
+	        debug(50, 1) ("comm_open: setsockopt(IP_TOS) on FD %d: %s\n",
+		new_socket, xstrerror());
+#else
+	debug(50, 0) ("comm_open: setsockopt(IP_TOS) not supported on this platform\n");
+#endif
+    }
     /* update fdstat */
     debug(5, 5) ("comm_open: FD %d is a new socket\n", new_socket);
     fd_open(new_socket, FD_SOCKET, note);
     F = &fd_table[new_socket];
+    F->local_addr = addr;
+    F->tos = tos;
     if (!(flags & COMM_NOCLOEXEC))
 	commSetCloseOnExec(new_socket);
     if ((flags & COMM_REUSEADDR))
@@ -303,6 +332,7 @@
 commResetFD(ConnectStateData * cs)
 {
     int fd2;
+    fde *F;
     if (!cbdataValid(cs->data))
 	return 0;
     statCounter.syscalls.sock.sockets++;
@@ -318,23 +348,34 @@
 	debug(5, 0) ("commResetFD: dup2: %s\n", xstrerror());
 	if (ENFILE == errno || EMFILE == errno)
 	    fdAdjustReserved();
+	close(fd2);
 	return 0;
     }
     close(fd2);
+    F = &fd_table[cs->fd];
     fd_table[cs->fd].flags.called_connect = 0;
     /*
      * yuck, this has assumptions about comm_open() arguments for
      * the original socket
      */
-    commSetCloseOnExec(cs->fd);
-    if (Config.Addrs.tcp_outgoing.s_addr != no_addr.s_addr) {
-	if (commBind(cs->fd, Config.Addrs.tcp_outgoing, 0) != COMM_OK) {
-	    return 0;
-	}
+    if (commBind(cs->fd, F->local_addr, F->local_port) != COMM_OK) {
+	debug(5, 0) ("commResetFD: bind: %s\n", xstrerror());
+	return 0;
     }
-    commSetNonBlocking(cs->fd);
+#ifdef IP_TOS
+    if (F->tos) {
+	int tos = F->tos;
+	if (setsockopt(cs->fd, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(int)) < 0)
+	        debug(50, 1) ("commResetFD: setsockopt(IP_TOS) on FD %d: %s\n", cs->fd, xstrerror());
+    }
+#endif
+    if (F->flags.close_on_exec)
+	commSetCloseOnExec(cs->fd);
+    if (F->flags.nonblocking)
+	commSetNonBlocking(cs->fd);
 #ifdef TCP_NODELAY
-    commSetTcpNoDelay(cs->fd);
+    if (F->flags.nodelay)
+	commSetTcpNoDelay(cs->fd);
 #endif
     if (Config.tcpRcvBufsz > 0)
 	commSetTcpRcvbuf(cs->fd, Config.tcpRcvBufsz);
@@ -786,6 +827,7 @@
     }
     if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0)
 	debug(50, 0) ("FD %d: set close-on-exec failed: %s\n", fd, xstrerror());
+    fd_table[fd].flags.close_on_exec = 1;
 #endif
 }
 
@@ -796,6 +838,7 @@
     int on = 1;
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0)
 	debug(50, 1) ("commSetTcpNoDelay: FD %d: %s\n", fd, xstrerror());
+    fd_table[fd].flags.nodelay = 1;
 }
 #endif
 
Index: squid/src/defines.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/defines.h,v
retrieving revision 1.3.22.14
retrieving revision 1.3.22.15
diff -u -r1.3.22.14 -r1.3.22.15
--- squid/src/defines.h	26 Aug 2001 09:02:01 -0000	1.3.22.14
+++ squid/src/defines.h	19 Oct 2001 19:05:10 -0000	1.3.22.15
@@ -1,6 +1,6 @@
 
 /*
- * $Id: defines.h,v 1.3.22.14 2001/08/26 09:02:01 serassio Exp $
+ * $Id: defines.h,v 1.3.22.15 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,6 +31,9 @@
  *
  */
 
+#ifndef SQUID_DEFINES_H
+#define SQUID_DEFINES_H
+
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -308,3 +311,5 @@
 #define _WIN_OS_WIN2K	6
 #define _WIN_OS_WINXP	7
 #endif
+
+#endif /* SQUID_DEFINES_H */
Index: squid/src/enums.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/enums.h,v
retrieving revision 1.6.10.5
retrieving revision 1.6.10.6
diff -u -r1.6.10.5 -r1.6.10.6
--- squid/src/enums.h	30 Sep 2001 20:38:14 -0000	1.6.10.5
+++ squid/src/enums.h	19 Oct 2001 19:05:10 -0000	1.6.10.6
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.6.10.5 2001/09/30 20:38:14 serassio Exp $
+ * $Id: enums.h,v 1.6.10.6 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,6 +31,9 @@
  *
  */
 
+#ifndef SQUID_ENUMS_H
+#define SQUID_ENUMS_H
+
 typedef enum {
     LOG_TAG_NONE,
     LOG_TCP_HIT,
@@ -138,7 +141,7 @@
     ACL_LOOKUP_NEEDED,
     ACL_LOOKUP_PENDING,
     ACL_LOOKUP_DONE,
-    ACL_PROXY_AUTH_NEEDED,
+    ACL_PROXY_AUTH_NEEDED
 } acl_lookup_state;
 
 enum {
@@ -510,7 +513,7 @@
     AUTH_ACL_CHALLENGE = -2,
     AUTH_ACL_HELPER = -1,
     AUTH_ACL_CANNOT_AUTHENTICATE = 0,
-    AUTH_AUTHENTICATED = 1,
+    AUTH_AUTHENTICATED = 1
 } auth_acl_t;
 
 typedef enum {
@@ -723,3 +726,5 @@
     VARY_OTHER,
     VARY_CANCEL
 };
+
+#endif /* SQUID_ENUMS_H */
Index: squid/src/forward.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/forward.c,v
retrieving revision 1.6.4.1
retrieving revision 1.6.4.2
diff -u -r1.6.4.1 -r1.6.4.2
--- squid/src/forward.c	14 Mar 2001 22:17:33 -0000	1.6.4.1
+++ squid/src/forward.c	19 Oct 2001 19:05:10 -0000	1.6.4.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.c,v 1.6.4.1 2001/03/14 22:17:33 rbcollins Exp $
+ * $Id: forward.c,v 1.6.4.2 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -266,6 +266,58 @@
     comm_close(fd);
 }
 
+static struct in_addr
+aclMapAddr(acl_address * head, aclCheck_t * ch)
+{
+    acl_address *l;
+    struct in_addr addr;
+    for (l = head; l; l = l->next) {
+	if (aclMatchAclList(l->acl_list, ch))
+	    return l->addr;
+    }
+    addr.s_addr = INADDR_ANY;
+    return addr;
+}
+
+static int
+aclMapTOS(acl_tos * head, aclCheck_t * ch)
+{
+    acl_tos *l;
+    for (l = head; l; l = l->next) {
+	if (aclMatchAclList(l->acl_list, ch))
+	    return l->tos;
+    }
+    return 0;
+}
+
+struct in_addr
+getOutgoingAddr(request_t * request)
+{
+    aclCheck_t ch;
+    memset(&ch, '\0', sizeof(aclCheck_t));
+    if (request) {
+	ch.src_addr = request->client_addr;
+	ch.my_addr = request->my_addr;
+	ch.my_port = request->my_port;
+	ch.request = request;
+    }
+    return aclMapAddr(Config.accessList.outgoing_address, &ch);
+}
+
+unsigned long
+getOutgoingTOS(request_t * request)
+{
+    aclCheck_t ch;
+    memset(&ch, '\0', sizeof(aclCheck_t));
+    if (request) {
+	ch.src_addr = request->client_addr;
+	ch.my_addr = request->my_addr;
+	ch.my_port = request->my_port;
+	ch.request = request;
+    }
+    return aclMapTOS(Config.accessList.outgoing_tos, &ch);
+}
+
 static void
 fwdConnectStart(void *data)
 {
@@ -277,6 +329,8 @@
     const char *host;
     unsigned short port;
     time_t ctimeout;
+    struct in_addr outgoing;
+    unsigned short tos;
     assert(fs);
     assert(fwdState->server_fd == -1);
     debug(17, 3) ("fwdConnectStart: %s\n", url);
@@ -306,11 +360,17 @@
 #if URL_CHECKSUM_DEBUG
     assert(fwdState->entry->mem_obj->chksum == url_checksum(url));
 #endif
-    fd = comm_open(SOCK_STREAM,
+    outgoing = getOutgoingAddr(fwdState->request);
+    tos = getOutgoingTOS(fwdState->request);
+
+    debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n",
+	inet_ntoa(outgoing), tos);
+    fd = comm_openex(SOCK_STREAM,
 	0,
-	Config.Addrs.tcp_outgoing,
+	outgoing,
 	0,
 	COMM_NONBLOCKING,
+	tos,
 	url);
     if (fd < 0) {
 	debug(50, 4) ("fwdConnectStart: %s\n", xstrerror());
Index: squid/src/ftp.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v
retrieving revision 1.5.16.3
retrieving revision 1.5.16.4
diff -u -r1.5.16.3 -r1.5.16.4
--- squid/src/ftp.c	30 Sep 2001 20:38:14 -0000	1.5.16.3
+++ squid/src/ftp.c	19 Oct 2001 19:05:10 -0000	1.5.16.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.c,v 1.5.16.3 2001/09/30 20:38:14 serassio Exp $
+ * $Id: ftp.c,v 1.5.16.4 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1680,7 +1680,8 @@
     if (getsockname(ftpState->ctrl.fd, (struct sockaddr *) &addr, &addr_len)) {
 	debug(9, 0) ("ftpSendPasv: getsockname(%d,..): %s\n",
 	    ftpState->ctrl.fd, xstrerror());
-	addr.sin_addr = Config.Addrs.tcp_outgoing;
+	ftpFail(ftpState);
+	return;
     }
     /* Open data channel with the same local address as control channel */
     fd = comm_open(SOCK_STREAM,
Index: squid/src/globals.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/globals.h,v
retrieving revision 1.5.12.13
retrieving revision 1.5.12.14
diff -u -r1.5.12.13 -r1.5.12.14
--- squid/src/globals.h	2 Sep 2001 08:46:08 -0000	1.5.12.13
+++ squid/src/globals.h	19 Oct 2001 19:05:10 -0000	1.5.12.14
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.5.12.13 2001/09/02 08:46:08 serassio Exp $
+ * $Id: globals.h,v 1.5.12.14 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,6 +31,9 @@
  *
  */
 
+#ifndef SQUID_GLOBALS_H
+#define SQUID_GLOBALS_H
+
 extern FILE *debug_log;		/* NULL */
 extern SquidConfig Config;
 extern SquidConfig2 Config2;
@@ -159,3 +162,5 @@
 extern unsigned int WIN32_OS_version;	/* 0 */
 extern char *WIN32_OS_string;
 #endif
+
+#endif /* SQUID_GLOBALS_H */
Index: squid/src/mk-globals-c.pl
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/mk-globals-c.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.72.1
diff -u -r1.1.1.1 -r1.1.1.1.72.1
--- squid/src/mk-globals-c.pl	26 Jan 2000 03:21:47 -0000	1.1.1.1
+++ squid/src/mk-globals-c.pl	19 Oct 2001 19:05:10 -0000	1.1.1.1.72.1
@@ -1,6 +1,7 @@
 print "#include \"squid.h\"\n";
 while (<>) {
 	$init = undef;
+	next if (/ SQUID_GLOBALS_H/);
 	if (/^#/) {
 		print;
 		next;
Index: squid/src/neighbors.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v
retrieving revision 1.6.10.3
retrieving revision 1.6.10.4
diff -u -r1.6.10.3 -r1.6.10.4
--- squid/src/neighbors.c	29 Jun 2001 21:23:22 -0000	1.6.10.3
+++ squid/src/neighbors.c	19 Oct 2001 19:05:10 -0000	1.6.10.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.c,v 1.6.10.3 2001/06/29 21:23:22 serassio Exp $
+ * $Id: neighbors.c,v 1.6.10.4 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -759,9 +759,9 @@
 
 /* ignoreMulticastReply
  * 
- * We want to ignore replies from multicast peers if the
- * cache_host_domain rules would normally prevent the peer
- * from being used
+ * * We want to ignore replies from multicast peers if the
+ * * cache_host_domain rules would normally prevent the peer
+ * * from being used
  */
 static int
 ignoreMulticastReply(peer * p, MemObject * mem)
@@ -1072,7 +1072,7 @@
 	return;			/* probe already running */
     if (squid_curtime - p->stats.last_connect_probe < Config.Timeout.connect)
 	return;			/* don't probe to often */
-    fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing,
+    fd = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL),
 	0, COMM_NONBLOCKING, p->host);
     if (fd < 0)
 	return;
Index: squid/src/protos.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/protos.h,v
retrieving revision 1.9.2.16
retrieving revision 1.9.2.17
diff -u -r1.9.2.16 -r1.9.2.17
--- squid/src/protos.h	30 Sep 2001 20:38:14 -0000	1.9.2.16
+++ squid/src/protos.h	19 Oct 2001 19:05:10 -0000	1.9.2.17
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.9.2.16 2001/09/30 20:38:14 serassio Exp $
+ * $Id: protos.h,v 1.9.2.17 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,6 +31,9 @@
  *
  */
 
+#ifndef SQUID_PROTOS_H
+#define SQUID_PROTOS_H
+
 extern void accessLogLog(AccessLogEntry *);
 extern void accessLogRotate(void);
 extern void accessLogClose(void);
@@ -56,7 +59,9 @@
 extern int aclMatchAclList(const acl_list * list, aclCheck_t * checklist);
 extern void aclDestroyAccessList(struct _acl_access **list);
 extern void aclDestroyAcls(acl **);
+extern void aclDestroyAclList(acl_list **);
 extern void aclParseAccessLine(struct _acl_access **);
+extern void aclParseAclList(acl_list **);
 extern void aclParseAclLine(acl **);
 extern int aclIsProxyAuth(const char *name);
 extern err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
@@ -150,6 +155,7 @@
 extern void comm_init(void);
 extern int comm_listen(int sock);
 extern int comm_open(int, int, struct in_addr, u_short port, int, const char *note);
+extern int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, const char *);
 extern u_short comm_local_port(int fd);
 
 extern void commSetSelect(int, unsigned int, PF *, void *, time_t);
@@ -424,9 +430,9 @@
 /* field manipulation */
 extern int httpHeaderHas(const HttpHeader * hdr, http_hdr_type type);
 extern void httpHeaderPutInt(HttpHeader * hdr, http_hdr_type type, int number);
-extern void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type type, time_t time);
+extern void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type type, time_t htime);
 extern void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str);
-extern void httpHeaderPutAuth(HttpHeader * hdr, const char *authScheme, const char *realm);
+extern void httpHeaderPutAuth(HttpHeader * hdr, const char *auth_scheme, const char *realm);
 extern void httpHeaderPutCc(HttpHeader * hdr, const HttpHdrCc * cc);
 extern void httpHeaderPutContRange(HttpHeader * hdr, const HttpHdrContRange * cr);
 extern void httpHeaderPutRange(HttpHeader * hdr, const HttpHdrRange * range);
@@ -440,7 +446,7 @@
 extern HttpHdrContRange *httpHeaderGetContRange(const HttpHeader * hdr);
 extern const char *httpHeaderGetStr(const HttpHeader * hdr, http_hdr_type id);
 extern const char *httpHeaderGetLastStr(const HttpHeader * hdr, http_hdr_type id);
-extern const char *httpHeaderGetAuth(const HttpHeader * hdr, http_hdr_type id, const char *authScheme);
+extern const char *httpHeaderGetAuth(const HttpHeader * hdr, http_hdr_type id, const char *auth_scheme);
 extern String httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id);
 extern String httpHeaderGetStrOrList(const HttpHeader * hdr, http_hdr_type id);
 extern String httpHeaderGetByName(const HttpHeader * hdr, const char *name);
@@ -674,16 +680,14 @@
 extern void netdbInit(void);
 extern void netdbHandlePingReply(const struct sockaddr_in *from, int hops, int rtt);
 extern void netdbPingSite(const char *hostname);
-extern void netdbInit(void);
 extern void netdbDump(StoreEntry *);
 extern int netdbHops(struct in_addr);
 extern void netdbFreeMemory(void);
 extern int netdbHostHops(const char *host);
 extern int netdbHostRtt(const char *host);
-extern int netdbHostPeerRtt(const char *host, peer * peer);
+extern int netdbHostPeerRtt(const char *host, peer * p);
 extern void netdbUpdatePeer(request_t *, peer * e, int rtt, int hops);
 extern void netdbDeleteAddrNetwork(struct in_addr addr);
-extern int netdbHostPeerRtt(const char *host, peer * peer);
 extern void netdbBinaryExchange(StoreEntry *);
 extern EVH netdbExchangeStart;
 extern void netdbExchangeUpdatePeer(struct in_addr, peer *, double, double);
@@ -717,6 +721,8 @@
 extern void fwdLogRotate(void);
 extern void fwdStatus(FwdState *, http_status);
 #endif
+struct in_addr getOutgoingAddr(request_t * request);
+unsigned long getOutgoingTOS(request_t * request);
 
 extern void urnStart(request_t *, StoreEntry *);
 
@@ -784,7 +790,8 @@
 
 /* ident.c */
 #if USE_IDENT
-extern void identStart(struct sockaddr_in *me, struct sockaddr_in *peer, IDCB * callback, void *cbdata);
+extern void identStart(struct sockaddr_in *me, struct sockaddr_in *my_peer,
+    IDCB * callback, void *cbdata);
 extern void identInit(void);
 #endif
 
@@ -885,16 +892,13 @@
 extern void storeLockObject(StoreEntry *);
 extern void storeRelease(StoreEntry *);
 extern int storeUnlockObject(StoreEntry *);
-extern int storePendingNClients(const StoreEntry *);
 extern EVH storeMaintainSwapSpace;
 extern void storeExpireNow(StoreEntry *);
 extern void storeReleaseRequest(StoreEntry *);
-extern off_t storeLowestMemReaderOffset(const StoreEntry *);
 extern void storeConfigure(void);
 extern void storeNegativeCache(StoreEntry *);
 extern void storeFreeMemory(void);
 extern int expiresMoreThan(time_t, time_t);
-extern void InvokeHandlers(StoreEntry *);
 extern int storeEntryValidToSend(StoreEntry *);
 extern void storeTimestampsSet(StoreEntry *);
 extern void storeRegisterAbort(StoreEntry * e, STABH * cb, void *);
@@ -1020,7 +1024,7 @@
  */
 extern void storeRebuildStart(void);
 extern void storeRebuildComplete(struct _store_rebuild_data *);
-extern void storeRebuildProgress(int index, int total, int sofar);
+extern void storeRebuildProgress(int sd_index, int total, int sofar);
 
 /*
  * store_swapin.c
@@ -1315,3 +1319,5 @@
 extern int WIN32_Subsystem_Init(void);
 extern void WIN32_Exit(void);
 #endif
+
+#endif /* SQUID_PROTOS_H */
Index: squid/src/ssl.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/ssl.c,v
retrieving revision 1.3.22.3
retrieving revision 1.3.22.4
diff -u -r1.3.22.3 -r1.3.22.4
--- squid/src/ssl.c	17 Jul 2001 18:44:12 -0000	1.3.22.3
+++ squid/src/ssl.c	19 Oct 2001 19:05:10 -0000	1.3.22.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.c,v 1.3.22.3 2001/07/17 18:44:12 serassio Exp $
+ * $Id: ssl.c,v 1.3.22.4 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -468,11 +468,12 @@
     statCounter.server.all.requests++;
     statCounter.server.other.requests++;
     /* Create socket. */
-    sock = comm_open(SOCK_STREAM,
+    sock = comm_openex(SOCK_STREAM,
 	0,
-	Config.Addrs.tcp_outgoing,
+	getOutgoingAddr(request),
 	0,
 	COMM_NONBLOCKING,
+	getOutgoingTOS(request),
 	url);
     if (sock == COMM_ERROR) {
 	debug(26, 4) ("sslStart: Failed because we're out of sockets.\n");
Index: squid/src/ssl_support.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/ssl_support.h,v
retrieving revision 1.1.30.2
retrieving revision 1.1.30.3
diff -u -r1.1.30.2 -r1.1.30.3
--- squid/src/ssl_support.h	6 May 2001 17:18:13 -0000	1.1.30.2
+++ squid/src/ssl_support.h	19 Oct 2001 19:05:10 -0000	1.1.30.3
@@ -32,8 +32,8 @@
  *
  */
 
-#ifndef SSL_SUPPORT_H
-#define SSL_SUPPORT_H
+#ifndef SQUID_SSL_SUPPORT_H
+#define SQUID_SSL_SUPPORT_H
 
 #include "config.h"
 #if HAVE_OPENSSL_SSL_H
@@ -47,4 +47,4 @@
 int ssl_read_method(int, char *, int);
 int ssl_write_method(int, const char *, int);
 
-#endif /* SSL_SUPPORT_H */
+#endif /* SQUID_SSL_SUPPORT_H */
Index: squid/src/store_rebuild.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/store_rebuild.c,v
retrieving revision 1.6.16.1
retrieving revision 1.6.16.2
diff -u -r1.6.16.1 -r1.6.16.2
--- squid/src/store_rebuild.c	14 Mar 2001 22:17:34 -0000	1.6.16.1
+++ squid/src/store_rebuild.c	19 Oct 2001 19:05:10 -0000	1.6.16.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_rebuild.c,v 1.6.16.1 2001/03/14 22:17:34 rbcollins Exp $
+ * $Id: store_rebuild.c,v 1.6.16.2 2001/10/19 19:05:10 serassio Exp $
  *
  * DEBUG: section 20    Store Rebuild Routines
  * AUTHOR: Duane Wessels
@@ -172,24 +172,24 @@
  * progress.
  */
 void
-storeRebuildProgress(int index, int total, int sofar)
+storeRebuildProgress(int sd_index, int total, int sofar)
 {
     static time_t last_report = 0;
     double n = 0.0;
     double d = 0.0;
-    if (index < 0)
+    if (sd_index < 0)
 	return;
-    if (index >= Config.cacheSwap.n_configured)
+    if (sd_index >= Config.cacheSwap.n_configured)
 	return;
     if (NULL == RebuildProgress)
 	return;
-    RebuildProgress[index].total = total;
-    RebuildProgress[index].scanned = sofar;
+    RebuildProgress[sd_index].total = total;
+    RebuildProgress[sd_index].scanned = sofar;
     if (squid_curtime - last_report < 15)
 	return;
-    for (index = 0; index < Config.cacheSwap.n_configured; index++) {
-	n += (double) RebuildProgress[index].scanned;
-	d += (double) RebuildProgress[index].total;
+    for (sd_index = 0; sd_index < Config.cacheSwap.n_configured; sd_index++) {
+	n += (double) RebuildProgress[sd_index].scanned;
+	d += (double) RebuildProgress[sd_index].total;
     }
     debug(20, 1) ("Store rebuilding is %4.1f%% complete\n", 100.0 * n / d);
     last_report = squid_curtime;
Index: squid/src/structs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/structs.h,v
retrieving revision 1.12.2.11
retrieving revision 1.12.2.12
diff -u -r1.12.2.11 -r1.12.2.12
--- squid/src/structs.h	30 Sep 2001 20:38:14 -0000	1.12.2.11
+++ squid/src/structs.h	19 Oct 2001 19:05:10 -0000	1.12.2.12
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.12.2.11 2001/09/30 20:38:14 serassio Exp $
+ * $Id: structs.h,v 1.12.2.12 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,6 +31,9 @@
  *
  */
 
+#ifndef SQUID_STRUCTS_H
+#define SQUID_STRUCTS_H
+
 #include "config.h"
 #include "splay.h"
 
@@ -257,6 +260,18 @@
     acl_access *next;
 };
 
+struct _acl_address {
+    acl_address *next;
+    acl_list *acl_list;
+    struct in_addr addr;
+};
+
+struct _acl_tos {
+    acl_tos *next;
+    acl_list *acl_list;
+    int tos;
+};
+
 struct _aclCheck_t {
     const acl_access *access_list;
     struct in_addr src_addr;
@@ -487,7 +502,6 @@
 	u_short port;
     } Announce;
     struct {
-	struct in_addr tcp_outgoing;
 	struct in_addr udp_incoming;
 	struct in_addr udp_outgoing;
 #if SQUID_SNMP
@@ -586,6 +600,8 @@
 #endif
 	acl_access *redirector;
 	acl_access *reply;
+	acl_address *outgoing_address;
+	acl_tos *outgoing_tos;
     } accessList;
     acl_deny_info_list *denyInfoList;
     struct _authConfig {
@@ -730,6 +746,8 @@
     unsigned int type;
     u_short local_port;
     u_short remote_port;
+    struct in_addr local_addr;
+    unsigned char tos;
     char ipaddr[16];		/* dotted decimal address of peer */
     char desc[FD_DESC_SZ];
     struct {
@@ -742,6 +760,8 @@
 	unsigned int nonblocking:1;
 	unsigned int ipc:1;
 	unsigned int called_connect:1;
+	unsigned int nodelay:1;
+	unsigned int close_on_exec:1;
     } flags;
     int bytes_read;
     int bytes_written;
@@ -1481,15 +1501,17 @@
     hash_link hash;		/* must be first */
     MemObject *mem_obj;
     RemovalPolicyNode repl;
+    /* START OF ON-DISK STORE_META_STD TLV field */
     time_t timestamp;
     time_t lastref;
     time_t expires;
     time_t lastmod;
     size_t swap_file_sz;
-    sfileno swap_filen:25;
-    sdirno swap_dirn:7;
     u_short refcount;
     u_short flags;
+    /* END OF ON-DISK STORE_META_STD */
+    sfileno swap_filen:25;
+    sdirno swap_dirn:7;
     u_short lock_count;		/* Assume < 65536! */
     mem_status_t mem_status:3;
     ping_status_t ping_status:3;
@@ -2135,3 +2157,5 @@
     void (*parse) (SwapDir * sd, const char *option, const char *value, int reconfiguring);
     void (*dump) (StoreEntry * e, const char *option, SwapDir * sd);
 };
+
+#endif /* SQUID_STRUCTS_H */
Index: squid/src/typedefs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v
retrieving revision 1.4.16.7
retrieving revision 1.4.16.8
diff -u -r1.4.16.7 -r1.4.16.8
--- squid/src/typedefs.h	12 Aug 2001 16:15:02 -0000	1.4.16.7
+++ squid/src/typedefs.h	19 Oct 2001 19:05:10 -0000	1.4.16.8
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.4.16.7 2001/08/12 16:15:02 serassio Exp $
+ * $Id: typedefs.h,v 1.4.16.8 2001/10/19 19:05:10 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -31,8 +31,8 @@
  *
  */
 
-#ifndef _TYPEDEFS_H_
-#define _TYPEDEFS_H_
+#ifndef SQUID_TYPEDEFS_H
+#define SQUID_TYPEDEFS_H
 
 typedef unsigned int store_status_t;
 typedef unsigned int mem_status_t;
@@ -75,6 +75,8 @@
 typedef struct _acl_snmp_comm acl_snmp_comm;
 typedef struct _acl_list acl_list;
 typedef struct _acl_access acl_access;
+typedef struct _acl_address acl_address;
+typedef struct _acl_tos acl_tos;
 typedef struct _aclCheck_t aclCheck_t;
 typedef struct _wordlist wordlist;
 typedef struct _intlist intlist;
@@ -358,4 +360,4 @@
 
 typedef int STDIRSELECT(const StoreEntry *);
 
-#endif /* _TYPEDEFS_H_ */
+#endif /* SQUID_TYPEDEFS_H */
Index: squid/src/auth/basic/auth_basic.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/auth_basic.c,v
retrieving revision 1.1.24.5
retrieving revision 1.1.24.6
diff -u -r1.1.24.5 -r1.1.24.6
--- squid/src/auth/basic/auth_basic.c	30 Sep 2001 20:38:14 -0000	1.1.24.5
+++ squid/src/auth/basic/auth_basic.c	19 Oct 2001 19:05:11 -0000	1.1.24.6
@@ -176,7 +176,7 @@
 
     assert(auth_user->scheme_data != NULL);
     basic_auth = auth_user->scheme_data;
-    
+
     /* if the password is not ok, do an identity */
     if (basic_auth->flags.credentials_ok != 1)
 	return;
Index: squid/src/auth/basic/auth_basic.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/auth_basic.h,v
retrieving revision 1.1.22.2
retrieving revision 1.1.22.3
diff -u -r1.1.22.2 -r1.1.22.3
--- squid/src/auth/basic/auth_basic.h	30 Sep 2001 20:38:14 -0000	1.1.22.2
+++ squid/src/auth/basic/auth_basic.h	19 Oct 2001 19:05:11 -0000	1.1.22.3
@@ -31,7 +31,7 @@
     char *passwd;
     time_t credentials_checkedtime;
     struct {
-        unsigned int credentials_ok:2;  /*0=unchecked,1=ok,2=failed */
+	unsigned int credentials_ok:2;	/*0=unchecked,1=ok,2=failed */
     } flags;
     auth_basic_queue_node *auth_queue;
 };
Index: squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.8
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/helpers/LDAP/Attic/squid_ldap_auth.8,v
retrieving revision 1.1.14.4
retrieving revision 1.1.14.5
diff -u -r1.1.14.4 -r1.1.14.5
--- squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.8	30 Sep 2001 20:38:14 -0000	1.1.14.4
+++ squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.8	19 Oct 2001 19:05:11 -0000	1.1.14.5
@@ -4,9 +4,9 @@
 squid_ldap_auth - Squid LDAP authentication helper
 .
 .SH SYNOPSIS
-squid_ldap_auth -b "base DN" [-u attribute] [options] ldap_server_name
+squid_ldap_auth -b "base DN" [-u attribute] [options] [ldap_server_name[:port]]...]
 .P
-squid_ldap_auth -b "base DN" -f "LDAP search filter" [options] ldap_server_name
+squid_ldap_auth -b "base DN" -f "LDAP search filter" [options] [ldap_server_name[:port]...]
 .
 .SH DESCRIPTION
 This helper allows Squid to connect to a LDAP directory to
@@ -93,6 +93,9 @@
 the base object
 .
 .TP
+.BI -h " ldapserver"
+Specify the LDAP server to connect to
+.TP
 .BI -p " ldapport"
 Specify an alternate TCP port where the ldap server is listening if
 other than the default LDAP port 389.
Index: squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/helpers/LDAP/Attic/squid_ldap_auth.c,v
retrieving revision 1.2.30.7
retrieving revision 1.2.30.8
diff -u -r1.2.30.7 -r1.2.30.8
--- squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.c	30 Sep 2001 20:38:14 -0000	1.2.30.7
+++ squid/src/auth/basic/helpers/LDAP/squid_ldap_auth.c	19 Oct 2001 19:05:14 -0000	1.2.30.8
@@ -1,5 +1,4 @@
 /*
- * 
  * squid_ldap_auth: authentication via ldap for squid proxy server
  * 
  * Maintainer: Henrik Nordstrom <hno@squid-cache.org>
@@ -12,7 +11,7 @@
  * 
  * Usage: squid_ldap_auth -b basedn [-s searchscope]
  *                        [-f searchfilter] [-D binddn -w bindpasswd]
- *                        [-u attr] [-p] [-R] <ldap_server_name>
+ *                        [-u attr] [-h host] [-p port] [-P] [-R] [ldap_server_name[:port]] ...
  * 
  * Dependencies: You need to get the OpenLDAP libraries
  * from http://www.openldap.org
@@ -23,6 +22,13 @@
  * or (at your option) any later version.
  *
  * Changes:
+ * 2001-10-04: Henrik Nordstrom <hno@squid-cache.org>
+ *             - Be consistent with the other helpers in how
+ *               spaces are managed. If there is space characters
+ *               then these are assumed to be part of the password
+ * 2001-09-05: Henrik Nordstrom <hno@squid-cache.org>
+ *             - Added ability to specify another default LDAP port to
+ *               connect to. Persistent connections moved to -P
  * 2001-05-02: Henrik Nordstrom <hno@squid-cache.org>
  *             - Support newer OpenLDAP 2.x libraries using the
  *               revised Internet Draft API which unfortunately
@@ -45,7 +51,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <lber.h>
-#include <ldap_cdefs.h>
 #include <ldap.h>
 
 /* Change this to your search base */
@@ -64,19 +69,19 @@
 /* Yuck.. we need to glue to different versions of the API */
 
 #if defined(LDAP_API_VERSION) && LDAP_API_VERSION > 1823
-static int 
+static int
 squid_ldap_errno(LDAP * ld)
 {
     int err = 0;
     ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &err);
     return err;
 }
-static void 
+static void
 squid_ldap_set_aliasderef(LDAP * ld, int deref)
 {
     ldap_set_option(ld, LDAP_OPT_DEREF, &deref);
 }
-static void 
+static void
 squid_ldap_set_referrals(LDAP * ld, int referrals)
 {
     int *value = referrals ? LDAP_OPT_ON : LDAP_OPT_OFF;
@@ -84,17 +89,17 @@
 }
 
 #else
-static int 
+static int
 squid_ldap_errno(LDAP * ld)
 {
     return ld->ld_errno;
 }
-static void 
+static void
 squid_ldap_set_aliasderef(LDAP * ld, int deref)
 {
     ld->ld_deref = deref;
 }
-static void 
+static void
 squid_ldap_set_referrals(LDAP * ld, int referrals)
 {
     if (referrals)
@@ -108,15 +113,15 @@
 main(int argc, char **argv)
 {
     char buf[256];
-    char *user, *passwd, *p;
-    char *ldapServer;
+    char *user, *passwd;
+    char *ldapServer = NULL;
     LDAP *ld = NULL;
     int tryagain;
     int port = LDAP_PORT;
 
     setbuf(stdout, NULL);
 
-    while (argc > 2 && argv[1][0] == '-') {
+    while (argc > 1 && argv[1][0] == '-') {
 	char *value = "";
 	char option = argv[1][1];
 	switch (option) {
@@ -124,7 +129,7 @@
 	case 'R':
 	    break;
 	default:
-	    if (strlen(argv[1]) > 2) {
+	    if (strlen(argv[1]) > 2 || argc <= 2) {
 		value = argv[1] + 2;
 	    } else {
 		value = argv[2];
@@ -136,6 +141,17 @@
 	argv++;
 	argc--;
 	switch (option) {
+	case 'h':
+	    if (ldapServer) {
+		int len = strlen(ldapServer) + 1 + strlen(value) + 1;
+		char *newhost = malloc(len);
+		snprintf(newhost, len, "%s %s", ldapServer, value);
+		free(ldapServer);
+		ldapServer = newhost;
+	    } else {
+		ldapServer = strdup(value);
+	    }
+	    break;
 	case 'b':
 	    basedn = value;
 	    break;
@@ -192,15 +208,34 @@
 	}
     }
 
-    if (!basedn || argc != 2) {
-	fprintf(stderr, "Usage: squid_ldap_auth [options] ldap_server_name\n\n");
+    while (argc > 1 && argv[1][0] == '-') {
+	char *value = argv[1];
+	if (ldapServer) {
+	    int len = strlen(ldapServer) + 1 + strlen(value) + 1;
+	    char *newhost = malloc(len);
+	    snprintf(newhost, len, "%s %s", ldapServer, value);
+	    free(ldapServer);
+	    ldapServer = newhost;
+	} else {
+	    ldapServer = strdup(value);
+	}
+	argc--;
+	argv++;
+    }
+    if (!ldapServer)
+	ldapServer = "localhost";
+
+    if (!basedn) {
+	fprintf(stderr, "Usage: squid_ldap_auth -b basedn [options] [ldap_server_name[:port]]...\n\n");
 	fprintf(stderr, "\t-b basedn (REQUIRED)\tbase dn under which to search\n");
 	fprintf(stderr, "\t-f filter\t\tsearch filter to locate user DN\n");
 	fprintf(stderr, "\t-u userattr\t\tusername DN attribute\n");
 	fprintf(stderr, "\t-s base|one|sub\t\tsearch scope\n");
 	fprintf(stderr, "\t-D binddn\t\tDN to bind as to perform searches\n");
 	fprintf(stderr, "\t-w bindpasswd\t\tpassword for binddn\n");
-	fprintf(stderr, "\t-p\t\t\tpersistent LDAP connection\n");
+	fprintf(stderr, "\t-h server\t\tLDAP server (defaults to localhost)\n");
+	fprintf(stderr, "\t-p port\t\t\tLDAP server port\n");
+	fprintf(stderr, "\t-P\t\t\tpersistent LDAP connection\n");
 	fprintf(stderr, "\t-R\t\t\tdo not follow referrals\n");
 	fprintf(stderr, "\t-a never|always|search|find\n\t\t\t\twhen to dereference aliases\n");
 	fprintf(stderr, "\n");
@@ -208,20 +243,14 @@
 	fprintf(stderr, "\tIf you need to bind as a user to perform searches then use the\n\t-D binddn -w bindpasswd options\n\n");
 	exit(1);
     }
-    ldapServer = (char *) argv[1];
-
     while (fgets(buf, 256, stdin) != NULL) {
-	if ((p = strchr(buf, '\n')) != NULL)
-	    *p = '\0';		/* strip \n */
-	if ((p = strchr(buf, '\r')) != NULL)
-	    *p = '\0';		/* strip \r */
+	user = strtok(buf, " \r\n");
+	passwd = strtok(NULL, "\r\n");
 
-	user = buf;
-	if ((passwd = strrchr(buf, ' ')) == NULL) {
+	if (!user || !passwd || !passwd[0]) {
 	    printf("ERR\n");
 	    continue;
 	}
-	*passwd++ = '\0';	/* Cut in username,password */
 	tryagain = 1;
       recover:
 	if (ld == NULL) {
Index: squid/src/auth/digest/auth_digest.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/digest/auth_digest.c,v
retrieving revision 1.1.16.3
retrieving revision 1.1.16.4
diff -u -r1.1.16.3 -r1.1.16.4
--- squid/src/auth/digest/auth_digest.c	30 Sep 2001 20:38:14 -0000	1.1.16.3
+++ squid/src/auth/digest/auth_digest.c	19 Oct 2001 19:05:14 -0000	1.1.16.4
@@ -42,6 +42,8 @@
 #include "rfc2617.h"
 #include "auth_digest.h"
 
+extern AUTHSSETUP authSchemeSetup_digest;
+
 static void
 authenticateStateFree(authenticateStateData * r)
 {
@@ -80,9 +82,9 @@
 static auth_digest_config *digestConfig = NULL;
 
 static int authdigest_initialised = 0;
-MemPool *digest_user_pool = NULL;
-MemPool *digest_request_pool = NULL;
-MemPool *digest_nonce_pool = NULL;
+static MemPool *digest_user_pool = NULL;
+static MemPool *digest_request_pool = NULL;
+static MemPool *digest_nonce_pool = NULL;
 
 CBDATA_TYPE(authenticateStateData);
 
@@ -94,23 +96,25 @@
 
 static void authenticateDigestNonceCacheCleanup(void *data);
 static digest_nonce_h *authenticateDigestNonceFindNonce(const char *nonceb64);
-digest_nonce_h *authenticateDigestNonceNew();
-void authenticateDigestNonceDelete(digest_nonce_h * nonce);
-void authenticateDigestNonceSetup();
-void authenticateDigestNonceShutdown();
-void authenticateDigestNonceReconfigure();
-const char *authenticateDigestNonceNonceb64(digest_nonce_h * nonce);
-int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
-int authDigestNonceIsStale(digest_nonce_h * nonce);
-void authDigestNonceEncode(digest_nonce_h * nonce);
-int authDigestNonceLastRequest(digest_nonce_h * nonce);
-void authDigestNonceLink(digest_nonce_h * nonce);
-void authDigestNonceUnlink(digest_nonce_h * nonce);
-int authDigestNonceLinks(digest_nonce_h * nonce);
-void authDigestNonceUserUnlink(digest_nonce_h * nonce);
-void authDigestNoncePurge(digest_nonce_h * nonce);
+static digest_nonce_h *authenticateDigestNonceNew();
+static void authenticateDigestNonceDelete(digest_nonce_h * nonce);
+static void authenticateDigestNonceSetup();
+static void authenticateDigestNonceShutdown();
+static void authenticateDigestNonceReconfigure();
+static const char *authenticateDigestNonceNonceb64(digest_nonce_h * nonce);
+static int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
+static int authDigestNonceIsStale(digest_nonce_h * nonce);
+static void authDigestNonceEncode(digest_nonce_h * nonce);
+static int authDigestNonceLastRequest(digest_nonce_h * nonce);
+static void authDigestNonceLink(digest_nonce_h * nonce);
+static void authDigestNonceUnlink(digest_nonce_h * nonce);
+#if NOT_USED
+static int authDigestNonceLinks(digest_nonce_h * nonce);
+#endif
+static void authDigestNonceUserUnlink(digest_nonce_h * nonce);
+static void authDigestNoncePurge(digest_nonce_h * nonce);
 
-void
+static void
 authDigestNonceEncode(digest_nonce_h * nonce)
 {
     if (!nonce)
@@ -120,7 +124,7 @@
     nonce->hash.key = xstrdup(base64_encode_bin((char *) &(nonce->noncedata), sizeof(digest_nonce_data)));
 }
 
-digest_nonce_h *
+static digest_nonce_h *
 authenticateDigestNonceNew()
 {
     digest_nonce_h *newnonce = memPoolAlloc(digest_nonce_pool);
@@ -190,7 +194,7 @@
     return newnonce;
 }
 
-void
+static void
 authenticateDigestNonceDelete(digest_nonce_h * nonce)
 {
     if (nonce) {
@@ -205,7 +209,7 @@
     }
 }
 
-void
+static void
 authenticateDigestNonceSetup()
 {
     if (!digest_nonce_pool)
@@ -217,7 +221,7 @@
     }
 }
 
-void
+static void
 authenticateDigestNonceShutdown()
 {
     /* 
@@ -240,12 +244,12 @@
     debug(29, 2) ("authenticateDigestNonceShutdown: Nonce cache shutdown\n");
 }
 
-void
+static void
 authenticateDigestNonceReconfigure()
 {
 }
 
-void
+static void
 authenticateDigestNonceCacheCleanup(void *data)
 {
     /*
@@ -277,7 +281,7 @@
 	eventAdd("Digest none cache maintenance", authenticateDigestNonceCacheCleanup, NULL, digestConfig->nonceGCInterval, 1);
 }
 
-void
+static void
 authDigestNonceLink(digest_nonce_h * nonce)
 {
     assert(nonce != NULL);
@@ -285,15 +289,17 @@
     debug(29, 9) ("authDigestNonceLink: nonce '%d' now at '%d'.\n", nonce, nonce->references);
 }
 
-int
+#if NOT_USED
+static int
 authDigestNonceLinks(digest_nonce_h * nonce)
 {
     if (!nonce)
 	return -1;
     return nonce->references;
 }
+#endif
 
-void
+static void
 authDigestNonceUnlink(digest_nonce_h * nonce)
 {
     assert(nonce != NULL);
@@ -307,7 +313,7 @@
 	authenticateDigestNonceDelete(nonce);
 }
 
-const char *
+static const char *
 authenticateDigestNonceNonceb64(digest_nonce_h * nonce)
 {
     if (!nonce)
@@ -315,7 +321,7 @@
     return nonce->hash.key;
 }
 
-digest_nonce_h *
+static digest_nonce_h *
 authenticateDigestNonceFindNonce(const char *nonceb64)
 {
     digest_nonce_h *nonce = NULL;
@@ -329,7 +335,7 @@
     return nonce;
 }
 
-int
+static int
 authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9])
 {
     int intnc;
@@ -351,7 +357,7 @@
     return -1;
 }
 
-int
+static int
 authDigestNonceIsStale(digest_nonce_h * nonce)
 {
     /* do we have a nonce ? */
@@ -378,7 +384,7 @@
 }
 
 /* return -1 if the digest will be stale on the next request */
-int
+static int
 authDigestNonceLastRequest(digest_nonce_h * nonce)
 {
     if (!nonce)
@@ -395,7 +401,7 @@
     return 0;
 }
 
-void
+static void
 authDigestNoncePurge(digest_nonce_h * nonce)
 {
     if (!nonce)
@@ -411,13 +417,15 @@
 /* USER related functions */
 
 
-int
+#if NOT_USED
+static int
 authDigestUsercmpname(digest_user_h * u1, digest_user_h * u2)
 {
     return strcmp(u1->username, u2->username);
 }
+#endif
 
-auth_user_t *
+static auth_user_t *
 authDigestUserFindUsername(const char *username)
 {
     auth_user_hash_pointer *usernamehash;
@@ -436,20 +444,20 @@
     return NULL;
 }
 
-digest_user_h *
+static digest_user_h *
 authDigestUserNew()
 {
     return memPoolAlloc(digest_user_pool);
 }
 
-void
+static void
 authDigestUserSetup()
 {
     if (!digest_user_pool)
 	digest_user_pool = memPoolCreate("Digest Scheme User Data", sizeof(digest_user_h));
 }
 
-void
+static void
 authDigestUserShutdown()
 {
     /*
@@ -476,7 +484,7 @@
 /* request related functions */
 
 /* delete the digest reuqest structure. Does NOT delete related structures */
-void
+static void
 authDigestRequestDelete(digest_request_h * digest_request)
 {
     if (digest_request->nonceb64)
@@ -502,14 +510,14 @@
     memPoolFree(digest_request_pool, digest_request);
 }
 
-void
+static void
 authDigestAURequestFree(auth_user_request_t * auth_user_request)
 {
     if (auth_user_request->scheme_data != NULL)
 	authDigestRequestDelete((digest_request_h *) auth_user_request->scheme_data);
 }
 
-digest_request_h *
+static digest_request_h *
 authDigestRequestNew()
 {
     digest_request_h *tmp;
@@ -518,14 +526,14 @@
     return tmp;
 }
 
-void
+static void
 authDigestRequestSetup()
 {
     if (!digest_request_pool)
 	digest_request_pool = memPoolCreate("Digest Scheme Request Data", sizeof(digest_request_h));
 }
 
-void
+static void
 authDigestRequestShutdown()
 {
     /* No requests should be in progress when we get here */
@@ -537,7 +545,7 @@
 }
 
 
-void
+static void
 authDigestDone(void)
 {
     if (digestauthenticators)
@@ -605,12 +613,12 @@
     authscheme->authConnLastHeader = NULL;
 }
 
-int
+static int
 authenticateDigestActive()
 {
     return (authdigest_initialised == 1) ? 1 : 0;
 }
-int
+static int
 authDigestConfigured()
 {
     if ((digestConfig != NULL) && (digestConfig->authenticate != NULL) &&
@@ -620,7 +628,7 @@
     return 0;
 }
 
-int
+static int
 authDigestAuthenticated(auth_user_request_t * auth_user_request)
 {
     digest_user_h *digest_user = auth_user_request->auth_user->scheme_data;
@@ -649,11 +657,10 @@
     assert(auth_user->scheme_data != NULL);
     digest_user = auth_user->scheme_data;
 
-     /* if the check has corrupted the user, just return */
+    /* if the check has corrupted the user, just return */
     if (digest_user->flags.credentials_ok == 3) {
 	return;
     }
-
     assert(auth_user_request->scheme_data != NULL);
     digest_request = auth_user_request->scheme_data;
 
@@ -701,7 +708,7 @@
     return;
 }
 
-int
+static int
 authenticateDigestDirection(auth_user_request_t * auth_user_request)
 {
     digest_request_h *digest_request;
@@ -725,7 +732,7 @@
 }
 
 /* add the [proxy]authorisation header */
-void
+static void
 authDigestAddHeader(auth_user_request_t * auth_user_request, HttpReply * rep, int accel)
 {
     int type;
@@ -754,7 +761,7 @@
 
 #if WAITING_FOR_TE
 /* add the [proxy]authorisation header */
-void
+static void
 authDigestAddTrailer(auth_user_request_t * auth_user_request, HttpReply * rep, int accel)
 {
     int type;
@@ -796,7 +803,7 @@
     }
 }
 
-void
+static void
 authenticateDigestUserFree(auth_user_t * auth_user)
 {
     digest_user_h *digest_user = auth_user->scheme_data;
@@ -944,7 +951,7 @@
 
 /* NonceUserUnlink: remove the reference to auth_user and unlink the node from the list */
 
-void
+static void
 authDigestNonceUserUnlink(digest_nonce_h * nonce)
 {
     digest_user_h *digest_user;
@@ -976,7 +983,7 @@
 
 /* authDigestUserLinkNonce: add a nonce to a given user's struct */
 
-void
+static void
 authDigestUserLinkNonce(auth_user_t * auth_user, digest_nonce_h * nonce)
 {
     dlink_node *node;
@@ -1003,7 +1010,7 @@
 }
 
 /* authenticateDigestUsername: return a pointer to the username in the */
-char *
+static char *
 authenticateDigestUsername(auth_user_t * auth_user)
 {
     digest_user_h *digest_user = auth_user->scheme_data;
@@ -1013,7 +1020,7 @@
 }
 
 /* setup the necessary info to log the username */
-void
+static void
 authDigestLogUsername(auth_user_request_t * auth_user_request, char *username)
 {
     auth_user_t *auth_user;
@@ -1202,7 +1209,7 @@
 	return;
     }
     /* we can't check the URI just yet. We'll check it in the
-    authenticate phase */
+     * authenticate phase */
 
     /* is the response the correct length? */
 
@@ -1279,7 +1286,7 @@
 	/* set the user type */
 	auth_user->auth_type = AUTH_DIGEST;
 	/* this auth_user struct is the one to get added to the
-	username cache */
+	 * username cache */
 	/* store user in hash's */
 	authenticateUserNameCacheAdd(auth_user);
 	/* 
Index: squid/src/auth/digest/auth_digest.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/digest/auth_digest.h,v
retrieving revision 1.1.16.2
retrieving revision 1.1.16.3
diff -u -r1.1.16.2 -r1.1.16.3
--- squid/src/auth/digest/auth_digest.h	30 Sep 2001 20:38:14 -0000	1.1.16.2
+++ squid/src/auth/digest/auth_digest.h	19 Oct 2001 19:05:15 -0000	1.1.16.3
@@ -25,7 +25,7 @@
     HASH HA1;
     int HA1created;
     struct {
-        unsigned int credentials_ok:2;  /*0=unchecked,1=ok,2=failed */
+	unsigned int credentials_ok:2;	/*0=unchecked,1=ok,2=failed */
     } flags;
     /* what nonces have been allocated to this user */
     dlink_list nonces;
@@ -59,7 +59,7 @@
 
 /* the nonce structure we'll pass around */
 struct _digest_nonce_h {
-    hash_link hash;	/* must be first */
+    hash_link hash;		/* must be first */
     digest_nonce_data noncedata;
     /* number of uses we've seen of this nonce */
     long nc;
Index: squid/src/auth/ntlm/auth_ntlm.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/auth_ntlm.c,v
retrieving revision 1.1.24.5
retrieving revision 1.1.24.6
diff -u -r1.1.24.5 -r1.1.24.6
--- squid/src/auth/ntlm/auth_ntlm.c	30 Sep 2001 20:38:14 -0000	1.1.24.5
+++ squid/src/auth/ntlm/auth_ntlm.c	19 Oct 2001 19:05:15 -0000	1.1.24.6
@@ -41,6 +41,8 @@
 #include "squid.h"
 #include "auth_ntlm.h"
 
+extern AUTHSSETUP authSchemeSetup_ntlm;
+
 static void
 authenticateStateFree(authenticateStateData * r)
 {
@@ -80,9 +82,9 @@
 
 static int authntlm_initialised = 0;
 
-MemPool *ntlm_helper_state_pool = NULL;
-MemPool *ntlm_user_pool = NULL;
-MemPool *ntlm_request_pool = NULL;
+static MemPool *ntlm_helper_state_pool = NULL;
+static MemPool *ntlm_user_pool = NULL;
+static MemPool *ntlm_request_pool = NULL;
 static auth_ntlm_config *ntlmConfig = NULL;
 
 static hash_table *proxy_auth_cache = NULL;
@@ -93,7 +95,7 @@
  *
  */
 
-void
+static void
 authNTLMDone(void)
 {
     debug(29, 2) ("authNTLMDone: shutting down NTLM authentication.\n");
@@ -124,7 +126,7 @@
 }
 
 /* free any allocated configuration details */
-void
+static void
 authNTLMFreeConfig(authScheme * scheme)
 {
     if (ntlmConfig == NULL)
@@ -255,14 +257,14 @@
     }
 }
 
-int
+static int
 authenticateNTLMActive()
 {
     return (authntlm_initialised == 1) ? 1 : 0;
 }
 
 
-int
+static int
 authNTLMConfigured()
 {
     if ((ntlmConfig != NULL) && (ntlmConfig->authenticate != NULL) && (ntlmConfig->authenticateChildren != 0) && (ntlmConfig->challengeuses > -1) && (ntlmConfig->challengelifetime > -1)) {
@@ -275,15 +277,15 @@
 
 /* NTLM Scheme */
 
-int
+static int
 authenticateNTLMDirection(auth_user_request_t * auth_user_request)
 {
     ntlm_request_t *ntlm_request = auth_user_request->scheme_data;
     /* null auth_user is checked for by authenticateDirection */
     switch (ntlm_request->auth_state) {
     case AUTHENTICATE_STATE_NONE:	/* no progress at all. */
-        if (ntlm_request->flags.credentials_ok != 2)
-	  debug(29, 1) ("authenticateNTLMDirection: called before NTLM Authenticate!. Report a bug to squid-dev. au %x\n", auth_user_request);
+	if (ntlm_request->flags.credentials_ok != 2)
+	    debug(29, 1) ("authenticateNTLMDirection: called before NTLM Authenticate!. Report a bug to squid-dev. au %x\n", auth_user_request);
 	return -2;
     case AUTHENTICATE_STATE_NEGOTIATE:		/* send to helper */
     case AUTHENTICATE_STATE_RESPONSE:	/*send to helper */
@@ -301,7 +303,7 @@
  * must be first. To ensure that, the configure use --enable-auth=ntlm, anything
  * else.
  */
-void
+static void
 authenticateNTLMFixErrorHeader(auth_user_request_t * auth_user_request, HttpReply * rep, http_hdr_type type, request_t * request)
 {
     ntlm_request_t *ntlm_request;
@@ -341,7 +343,7 @@
     }
 }
 
-void
+static void
 authNTLMRequestFree(ntlm_request_t * ntlm_request)
 {
     if (!ntlm_request)
@@ -360,7 +362,7 @@
     memPoolFree(ntlm_request_pool, ntlm_request);
 }
 
-void
+static void
 authNTLMAURequestFree(auth_user_request_t * auth_user_request)
 {
     if (auth_user_request->scheme_data)
@@ -368,7 +370,7 @@
     auth_user_request->scheme_data = NULL;
 }
 
-void
+static void
 authenticateNTLMFreeUser(auth_user_t * auth_user)
 {
     dlink_node *link, *tmplink;
@@ -438,12 +440,10 @@
 	authenticateStateFree(r);
 	debug(29, 9) ("NTLM HandleReply, telling stateful helper : %d\n", S_HELPER_RELEASE);
 	return S_HELPER_RELEASE;
-    } 
-    
+    }
     if (!reply) {
 	fatal("authenticateNTLMHandleReply: called with no result string\n");
-    } 
-
+    }
     /* seperate out the useful data */
     if (strncasecmp(reply, "TT ", 3) == 0) {
 	reply += 3;
@@ -486,7 +486,7 @@
 	assert(ntlm_request->auth_state == AUTHENTICATE_STATE_RESPONSE);
 	ntlm_user->username = xstrndup(reply, MAX_LOGIN_SZ);
 	ntlm_request->authserver = NULL;
-	ntlm_request->flags.credentials_ok = 1;	/* login ok */
+	ntlm_request->flags.credentials_ok = 1;		/* login ok */
 #ifdef NTLM_FAIL_OPEN
     } else if (strncasecmp(reply, "LD ", 3) == 0) {
 	/* This is a variant of BH, which rather than deny access
@@ -513,7 +513,7 @@
 	ntlm_user->username = xstrndup(reply, MAX_LOGIN_SZ);
 	helperstate = helperStatefulServerGetData(ntlm_request->authserver);
 	ntlm_request->authserver = NULL;
-	ntlm_request->flags.credentials_ok = 1;	/* login ok */
+	ntlm_request->flags.credentials_ok = 1;		/* login ok */
 	/* BH code: mark helper as broken */
 	/* Not a valid helper response to a YR request. Assert so the helper
 	 * programmer will fix their bugs! */
@@ -534,14 +534,14 @@
 	/* todo: action of Negotiate state on error */
 	result = S_HELPER_RELEASE;	/*some error has occured. no more requests */
 	ntlm_request->authserver = NULL;
-	ntlm_request->flags.credentials_ok = 2;	/* Login/Usercode failed */
+	ntlm_request->flags.credentials_ok = 2;		/* Login/Usercode failed */
 	debug(29, 4) ("authenticateNTLMHandleReply: Error validating user via NTLM. Error returned '%s'\n", reply);
 	ntlm_request->auth_state = AUTHENTICATE_STATE_NONE;
 	if ((t = strchr(reply, ' ')))	/* strip after a space */
 	    *t = '\0';
     } else if (strncasecmp(reply, "NA", 2) == 0) {
 	/* NTLM Helper protocol violation! */
-	fatal ("NTLM Helper returned invalid response \"NA\" - a error message MUST be attached\n");
+	fatal("NTLM Helper returned invalid response \"NA\" - a error message MUST be attached\n");
     } else if (strncasecmp(reply, "BH ", 3) == 0) {
 	/* TODO kick off a refresh process. This can occur after a YR or after
 	 * a KK. If after a YR release the helper and resubmit the request via 
@@ -558,7 +558,7 @@
 	assert((ntlm_user != NULL) && (ntlm_request != NULL));
 	result = S_HELPER_RELEASE;	/*some error has occured. no more requests for 
 					 * this helper */
-	assert (ntlm_request->authserver ? ntlm_request->authserver == lastserver : 1);
+	assert(ntlm_request->authserver ? ntlm_request->authserver == lastserver : 1);
 	helperstate = helperStatefulServerGetData(ntlm_request->authserver);
 	ntlm_request->authserver = NULL;
 	if (ntlm_request->auth_state == AUTHENTICATE_STATE_NEGOTIATE) {
@@ -600,8 +600,8 @@
 	debug(29, 1) ("authenticateNTLMHandleReply: *** Unsupported helper response ***, '%s'\n", reply);
 	/* restart the authentication process */
 	ntlm_request->auth_state = AUTHENTICATE_STATE_NONE;
-	ntlm_request->flags.credentials_ok = 3;	/* cannot process */
-	assert (ntlm_request->authserver ? ntlm_request->authserver == lastserver : 1);
+	ntlm_request->flags.credentials_ok = 3;		/* cannot process */
+	assert(ntlm_request->authserver ? ntlm_request->authserver == lastserver : 1);
 	ntlm_request->authserver = NULL;
     }
     r->handler(r->data, NULL);
@@ -619,7 +619,7 @@
 }
 
 /* is a particular challenge still valid ? */
-int
+static int
 authenticateNTLMValidChallenge(ntlm_helper_state_t * helperstate)
 {
     debug(29, 9) ("authenticateNTLMValidChallenge: Challenge is %s\n", helperstate->challenge ? "Valid" : "Invalid");
@@ -629,7 +629,7 @@
 }
 
 /* does our policy call for changing the challenge now? */
-int
+static int
 authenticateNTLMChangeChallenge_p(ntlm_helper_state_t * helperstate)
 {
     /* don't check for invalid challenges just for expiry choices */
@@ -776,7 +776,7 @@
 }
 
 /* callback used by stateful helper routines */
-int
+static int
 authenticateNTLMHelperServerAvailable(void *data)
 {
     ntlm_helper_state_t *statedata = data;
@@ -793,7 +793,7 @@
     return 0;
 }
 
-void
+static void
 authenticateNTLMHelperServerOnEmpty(void *data)
 {
     ntlm_helper_state_t *statedata = data;
@@ -812,7 +812,7 @@
 
 
 /* clear the NTLM helper of being reserved for future requests */
-void
+static void
 authenticateNTLMReleaseServer(auth_user_request_t * auth_user_request)
 {
     ntlm_request_t *ntlm_request;
@@ -825,7 +825,7 @@
 }
 
 /* clear any connection related authentication details */
-void
+static void
 authenticateNTLMOnCloseConnection(ConnStateData * conn)
 {
     ntlm_request_t *ntlm_request;
@@ -833,7 +833,7 @@
     if (conn->auth_user_request != NULL) {
 	assert(conn->auth_user_request->scheme_data != NULL);
 	ntlm_request = conn->auth_user_request->scheme_data;
-	assert (ntlm_request->conn == conn);
+	assert(ntlm_request->conn == conn);
 	if (ntlm_request->authserver != NULL && ntlm_request->authserver_deferred)
 	    authenticateNTLMReleaseServer(conn->auth_user_request);
 	/* unlock the connection based lock */
@@ -850,7 +850,7 @@
 }
 
 /* authenticateUserUsername: return a pointer to the username in the */
-char *
+static char *
 authenticateNTLMUsername(auth_user_t * auth_user)
 {
     ntlm_user_t *ntlm_user = auth_user->scheme_data;
@@ -862,7 +862,7 @@
 /* NTLMLastHeader: return a pointer to the last header used in authenticating
  * the request/conneciton
  */
-const char *
+static const char *
 NTLMLastHeader(auth_user_request_t * auth_user_request)
 {
     ntlm_request_t *ntlm_request;
@@ -877,7 +877,7 @@
  * Auth_user structure.
  */
 
-void
+static void
 authenticateDecodeNTLMAuth(auth_user_request_t * auth_user_request, const char *proxy_auth)
 {
     dlink_node *node;
@@ -897,7 +897,7 @@
     return;
 }
 
-int
+static int
 authenticateNTLMcmpUsername(ntlm_user_t * u1, ntlm_user_t * u2)
 {
     return strcmp(u1->username, u2->username);
@@ -908,7 +908,7 @@
  * and sends the same response to squid on a single select cycle.
  * Check for this and if found ignore the new link 
  */
-void
+static void
 authenticateProxyAuthCacheAddLink(const char *key, auth_user_t * auth_user)
 {
     auth_user_hash_pointer *proxy_auth_hash;
@@ -930,7 +930,7 @@
 }
 
 
-int
+static int
 authNTLMAuthenticated(auth_user_request_t * auth_user_request)
 {
     ntlm_request_t *ntlm_request = auth_user_request->scheme_data;
@@ -1069,7 +1069,7 @@
 	/* set these to now because this is either a new login from an 
 	 * existing user or a new user */
 	auth_user->expiretime = current_time.tv_sec;
-	ntlm_request->flags.credentials_ok = 1;	/*authenticated ok */
+	ntlm_request->flags.credentials_ok = 1;		/*authenticated ok */
 	return;
 	break;
     case AUTHENTICATE_STATE_DONE:
Index: squid/src/auth/ntlm/auth_ntlm.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/auth_ntlm.h,v
retrieving revision 1.1.22.4
retrieving revision 1.1.22.5
diff -u -r1.1.22.4 -r1.1.22.5
--- squid/src/auth/ntlm/auth_ntlm.h	30 Sep 2001 20:38:14 -0000	1.1.22.4
+++ squid/src/auth/ntlm/auth_ntlm.h	19 Oct 2001 19:05:15 -0000	1.1.22.5
@@ -23,7 +23,7 @@
 
 struct _ntlm_request {
     struct {
-        unsigned int credentials_ok:2;  /*0=unchecked,1=ok,2=failed */
+	unsigned int credentials_ok:2;	/*0=unchecked,1=ok,2=failed */
     } flags;
     /* what negotiate string did the client use? */
     char *ntlmnegotiate;
@@ -38,7 +38,7 @@
     /* have we got the helper-server in a deferred state? */
     int authserver_deferred;
     /* what connection is this associated with */
-    ConnStateData * conn;
+    ConnStateData *conn;
 };
 
 struct _ntlm_helper_state_t {
Index: squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/libntlmssp.c,v
retrieving revision 1.4.16.2
retrieving revision 1.4.16.3
diff -u -r1.4.16.2 -r1.4.16.3
--- squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c	30 Aug 2001 17:13:11 -0000	1.4.16.2
+++ squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c	19 Oct 2001 19:05:15 -0000	1.4.16.3
@@ -121,7 +121,7 @@
 	debug("Couldn't connect to SMB Server. Error:%s\n", errstr);
 	return 1;
     }
-    if (SMB_Negotiate(handle, SMB_Prots) < 0) { /* An error */
+    if (SMB_Negotiate(handle, SMB_Prots) < 0) {		/* An error */
 	debug("Error negotiating protocol with SMB Server\n");
 	SMB_Discon(handle, 0);
 	handle = NULL;
Index: squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/ntlm.h,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -r1.4.2.3 -r1.4.2.4
--- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h	30 Aug 2001 17:13:11 -0000	1.4.2.3
+++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h	19 Oct 2001 19:05:15 -0000	1.4.2.4
@@ -97,7 +97,7 @@
 struct _dc {
     char *domain;
     char *controller;
-    time_t dead; /* 0 if it's alive, otherwise time of death */
+    time_t dead;		/* 0 if it's alive, otherwise time of death */
     dc *next;
 };
 
Index: squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/ntlm_auth.c,v
retrieving revision 1.6.2.4
retrieving revision 1.6.2.5
diff -u -r1.6.2.4 -r1.6.2.5
--- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c	30 Aug 2001 17:13:11 -0000	1.6.2.4
+++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c	19 Oct 2001 19:05:15 -0000	1.6.2.5
@@ -67,11 +67,12 @@
 char smb_error_buffer[1000];
 
 /* signal handler to be invoked when the authentication operation
-	 times out */
-static char got_timeout=0;
+ * times out */
+static char got_timeout = 0;
 static void
-timeout_during_auth(int signum) {
-	dc_disconnect();
+timeout_during_auth(int signum)
+{
+    dc_disconnect();
 }
 
 /* makes a null-terminated string upper-case. Changes CONTENTS! */
@@ -308,16 +309,16 @@
 	    /* notreached */
 	case NTLM_AUTHENTICATE:
 	    /* check against the DC */
-	    plen = strlen(buf) * 3 / 4; /* we only need it here. Optimization */
-	    signal(SIGALRM,timeout_during_auth);
+	    plen = strlen(buf) * 3 / 4;		/* we only need it here. Optimization */
+	    signal(SIGALRM, timeout_during_auth);
 	    alarm(30);
 	    cred = ntlm_check_auth((ntlm_authenticate *) decoded, plen);
 	    alarm(0);
-	    signal(SIGALRM,SIG_DFL);
+	    signal(SIGALRM, SIG_DFL);
 	    if (got_timeout != 0) {
-		fprintf(stderr,"ntlm-auth[%d]: Timeout during authentication.\n", getpid());
+		fprintf(stderr, "ntlm-auth[%d]: Timeout during authentication.\n", getpid());
 		SEND("BH Timeout during authentication");
-		got_timeout=0;
+		got_timeout = 0;
 		return;
 	    }
 	    if (cred == NULL) {
Index: squid/src/fs/aufs/aiops.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/aiops.c,v
retrieving revision 1.4.16.3
retrieving revision 1.4.16.4
diff -u -r1.4.16.3 -r1.4.16.4
--- squid/src/fs/aufs/aiops.c	25 Aug 2001 08:28:46 -0000	1.4.16.3
+++ squid/src/fs/aufs/aiops.c	19 Oct 2001 19:05:15 -0000	1.4.16.4
@@ -148,7 +148,7 @@
 #define AIO_MICRO_BUFS	128
 
 static MemPool *squidaio_large_bufs = NULL;	/* 16K */
-static MemPool *squidaio_medium_bufs = NULL;		/* 8K */
+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 */
Index: squid/src/fs/aufs/async_io.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/async_io.c,v
retrieving revision 1.3.24.2
retrieving revision 1.3.24.3
diff -u -r1.3.24.2 -r1.3.24.3
--- squid/src/fs/aufs/async_io.c	25 Aug 2001 08:28:46 -0000	1.3.24.2
+++ squid/src/fs/aufs/async_io.c	19 Oct 2001 19:05:15 -0000	1.3.24.3
@@ -155,14 +155,10 @@
     assert(initialised);
     squidaio_counts.cancel++;
     for (m = used_list.head; m; m = next) {
-	while (m) {
-	    curr = m->data;
-	    if (curr->fd == fd)
-		break;
-	    m = m->next;
-	}
-	if (m == NULL)
-	    break;
+	next = m->next;
+	curr = m->data;
+	if (curr->fd != fd)
+	    continue;
 
 	squidaio_cancel(&curr->result);
 
@@ -175,7 +171,6 @@
 		done_handler(fd, their_data, -2, -2);
 	    cbdataUnlock(their_data);
 	}
-	next = m->next;
 	dlinkDelete(m, &used_list);
 	memPoolFree(squidaio_ctrl_pool, curr);
     }
Index: squid/src/fs/aufs/store_dir_aufs.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_dir_aufs.c,v
retrieving revision 1.6.10.6
retrieving revision 1.6.10.7
diff -u -r1.6.10.6 -r1.6.10.7
--- squid/src/fs/aufs/store_dir_aufs.c	25 Aug 2001 08:28:46 -0000	1.6.10.6
+++ squid/src/fs/aufs/store_dir_aufs.c	19 Oct 2001 19:05:15 -0000	1.6.10.7
@@ -79,9 +79,9 @@
 static char *storeAufsDirSwapLogFile(SwapDir *, const char *);
 static EVH storeAufsDirRebuildFromDirectory;
 static EVH storeAufsDirRebuildFromSwapLog;
-static int storeAufsDirGetNextFile(RebuildState *, int *sfileno, int *size);
+static int storeAufsDirGetNextFile(RebuildState *, sfileno *, int *size);
 static StoreEntry *storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key,
-    int file_number,
+    sfileno file_number,
     size_t swap_file_sz,
     time_t expires,
     time_t timestamp,
@@ -129,27 +129,24 @@
  */
 
 static int
-storeAufsDirMapBitTest(SwapDir * SD, int fn)
+storeAufsDirMapBitTest(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     squidaioinfo_t *aioinfo;
     aioinfo = (squidaioinfo_t *) SD->fsdata;
     return file_map_bit_test(aioinfo->map, filn);
 }
 
 static void
-storeAufsDirMapBitSet(SwapDir * SD, int fn)
+storeAufsDirMapBitSet(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     squidaioinfo_t *aioinfo;
     aioinfo = (squidaioinfo_t *) SD->fsdata;
     file_map_bit_set(aioinfo->map, filn);
 }
 
 void
-storeAufsDirMapBitReset(SwapDir * SD, int fn)
+storeAufsDirMapBitReset(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     squidaioinfo_t *aioinfo;
     aioinfo = (squidaioinfo_t *) SD->fsdata;
     /*
@@ -381,7 +378,7 @@
     StoreEntry *e = NULL;
     StoreEntry tmpe;
     cache_key key[MD5_DIGEST_CHARS];
-    int sfileno = 0;
+    sfileno filn = 0;
     int count;
     int size;
     struct stat sb;
@@ -393,7 +390,7 @@
     debug(20, 3) ("storeAufsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index);
     for (count = 0; count < rb->speed; count++) {
 	assert(fd == -1);
-	fd = storeAufsDirGetNextFile(rb, &sfileno, &size);
+	fd = storeAufsDirGetNextFile(rb, &filn, &size);
 	if (fd == -2) {
 	    debug(20, 1) ("Done scanning %s swaplog (%d entries)\n",
 		rb->sd->path, rb->n_read);
@@ -418,7 +415,7 @@
 	if ((++rb->counts.scancount & 0xFFFF) == 0)
 	    debug(20, 3) ("  %s %7d files opened so far.\n",
 		rb->sd->path, rb->counts.scancount);
-	debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+	debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
 	statCounter.syscalls.disk.reads++;
 	if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
 	    debug(20, 1) ("storeAufsDirRebuildFromDirectory: read(FD %d): %s\n",
@@ -440,7 +437,7 @@
 	if (tlv_list == NULL) {
 	    debug(20, 1) ("storeAufsDirRebuildFromDirectory: failed to get meta data\n");
 	    /* XXX shouldn't this be a call to storeAufsUnlink ? */
-	    storeAufsDirUnlinkFile(SD, sfileno);
+	    storeAufsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	debug(20, 3) ("storeAufsDirRebuildFromDirectory: successful swap meta unpacking\n");
@@ -464,7 +461,7 @@
 	tlv_list = NULL;
 	if (storeKeyNull(key)) {
 	    debug(20, 1) ("storeAufsDirRebuildFromDirectory: NULL key\n");
-	    storeAufsDirUnlinkFile(SD, sfileno);
+	    storeAufsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	tmpe.hash.key = key;
@@ -476,11 +473,11 @@
 	} else if (tmpe.swap_file_sz != sb.st_size) {
 	    debug(20, 1) ("storeAufsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
 		tmpe.swap_file_sz, (int) sb.st_size);
-	    storeAufsDirUnlinkFile(SD, sfileno);
+	    storeAufsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
-	    storeAufsDirUnlinkFile(SD, sfileno);
+	    storeAufsDirUnlinkFile(SD, filn);
 	    rb->counts.badflags++;
 	    continue;
 	}
@@ -499,7 +496,7 @@
 	rb->counts.objcount++;
 	storeEntryDump(&tmpe, 5);
 	e = storeAufsDirAddDiskRestore(SD, key,
-	    sfileno,
+	    filn,
 	    tmpe.swap_file_sz,
 	    tmpe.expires,
 	    tmpe.timestamp,
@@ -690,7 +687,7 @@
 }
 
 static int
-storeAufsDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
+storeAufsDirGetNextFile(RebuildState * rb, sfileno *filn_p, int *size)
 {
     SwapDir *SD = rb->sd;
     squidaioinfo_t *aioinfo = (squidaioinfo_t *) SD->fsdata;
@@ -772,7 +769,7 @@
 	rb->curlvl1 = 0;
 	rb->done = 1;
     }
-    *sfileno = rb->fn;
+    *filn_p = rb->fn;
     return fd;
 }
 
@@ -780,7 +777,7 @@
  * use to rebuild store from disk. */
 static StoreEntry *
 storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key,
-    int file_number,
+    sfileno file_number,
     size_t swap_file_sz,
     time_t expires,
     time_t timestamp,
Index: squid/src/fs/diskd/store_dir_diskd.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_dir_diskd.c,v
retrieving revision 1.5.10.7
retrieving revision 1.5.10.8
diff -u -r1.5.10.7 -r1.5.10.8
--- squid/src/fs/diskd/store_dir_diskd.c	30 Sep 2001 20:38:15 -0000	1.5.10.7
+++ squid/src/fs/diskd/store_dir_diskd.c	19 Oct 2001 19:05:16 -0000	1.5.10.8
@@ -83,9 +83,9 @@
 static char *storeDiskdDirSwapLogFile(SwapDir *, const char *);
 static EVH storeDiskdDirRebuildFromDirectory;
 static EVH storeDiskdDirRebuildFromSwapLog;
-static int storeDiskdDirGetNextFile(RebuildState *, int *sfileno, int *size);
+static int storeDiskdDirGetNextFile(RebuildState *, sfileno *, int *size);
 static StoreEntry *storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key,
-    int file_number,
+    sfileno file_number,
     size_t swap_file_sz,
     time_t expires,
     time_t timestamp,
@@ -135,27 +135,24 @@
  */
 
 static int
-storeDiskdDirMapBitTest(SwapDir * SD, int fn)
+storeDiskdDirMapBitTest(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     diskdinfo_t *diskdinfo;
     diskdinfo = SD->fsdata;
     return file_map_bit_test(diskdinfo->map, filn);
 }
 
 static void
-storeDiskdDirMapBitSet(SwapDir * SD, int fn)
+storeDiskdDirMapBitSet(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     diskdinfo_t *diskdinfo;
     diskdinfo = SD->fsdata;
     file_map_bit_set(diskdinfo->map, filn);
 }
 
 void
-storeDiskdDirMapBitReset(SwapDir * SD, int fn)
+storeDiskdDirMapBitReset(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     diskdinfo_t *diskdinfo;
     diskdinfo = SD->fsdata;
     /* 
@@ -546,7 +543,7 @@
     StoreEntry *e = NULL;
     StoreEntry tmpe;
     cache_key key[MD5_DIGEST_CHARS];
-    int sfileno = 0;
+    sfileno filn = 0;
     int count;
     int size;
     struct stat sb;
@@ -558,7 +555,7 @@
     debug(20, 3) ("storeDiskdDirRebuildFromDirectory: DIR #%d\n", rb->sd->index);
     for (count = 0; count < rb->speed; count++) {
 	assert(fd == -1);
-	fd = storeDiskdDirGetNextFile(rb, &sfileno, &size);
+	fd = storeDiskdDirGetNextFile(rb, &filn, &size);
 	if (fd == -2) {
 	    debug(20, 1) ("Done scanning %s swaplog (%d entries)\n",
 		rb->sd->path, rb->n_read);
@@ -583,7 +580,7 @@
 	if ((++rb->counts.scancount & 0xFFFF) == 0)
 	    debug(20, 3) ("  %s %7d files opened so far.\n",
 		rb->sd->path, rb->counts.scancount);
-	debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+	debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
 	statCounter.syscalls.disk.reads++;
 	if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
 	    debug(20, 1) ("storeDiskdDirRebuildFromDirectory: read(FD %d): %s\n",
@@ -605,7 +602,7 @@
 	if (tlv_list == NULL) {
 	    debug(20, 1) ("storeDiskdDirRebuildFromDirectory: failed to get meta data\n");
 	    /* XXX shouldn't this be a call to storeDiskdUnlink ? */
-	    storeDiskdDirUnlinkFile(SD, sfileno);
+	    storeDiskdDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	debug(20, 3) ("storeDiskdDirRebuildFromDirectory: successful swap meta unpacking\n");
@@ -629,7 +626,7 @@
 	tlv_list = NULL;
 	if (storeKeyNull(key)) {
 	    debug(20, 1) ("storeDiskdDirRebuildFromDirectory: NULL key\n");
-	    storeDiskdDirUnlinkFile(SD, sfileno);
+	    storeDiskdDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	tmpe.hash.key = key;
@@ -641,11 +638,11 @@
 	} else if (tmpe.swap_file_sz != sb.st_size) {
 	    debug(20, 1) ("storeDiskdDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
 		tmpe.swap_file_sz, (int) sb.st_size);
-	    storeDiskdDirUnlinkFile(SD, sfileno);
+	    storeDiskdDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
-	    storeDiskdDirUnlinkFile(SD, sfileno);
+	    storeDiskdDirUnlinkFile(SD, filn);
 	    rb->counts.badflags++;
 	    continue;
 	}
@@ -664,7 +661,7 @@
 	rb->counts.objcount++;
 	storeEntryDump(&tmpe, 5);
 	e = storeDiskdDirAddDiskRestore(SD, key,
-	    sfileno,
+	    filn,
 	    tmpe.swap_file_sz,
 	    tmpe.expires,
 	    tmpe.timestamp,
@@ -880,7 +877,7 @@
 }
 
 static int
-storeDiskdDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
+storeDiskdDirGetNextFile(RebuildState * rb, sfileno *filn_p, int *size)
 {
     SwapDir *SD = rb->sd;
     diskdinfo_t *diskdinfo = SD->fsdata;
@@ -962,7 +959,7 @@
 	rb->curlvl1 = 0;
 	rb->done = 1;
     }
-    *sfileno = rb->fn;
+    *filn_p = rb->fn;
     return fd;
 }
 
Index: squid/src/fs/ufs/store_dir_ufs.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v
retrieving revision 1.5.10.9
retrieving revision 1.5.10.10
diff -u -r1.5.10.9 -r1.5.10.10
--- squid/src/fs/ufs/store_dir_ufs.c	16 Jul 2001 17:43:35 -0000	1.5.10.9
+++ squid/src/fs/ufs/store_dir_ufs.c	19 Oct 2001 19:05:17 -0000	1.5.10.10
@@ -77,7 +77,7 @@
 static char *storeUfsDirSwapLogFile(SwapDir *, const char *);
 static EVH storeUfsDirRebuildFromDirectory;
 static EVH storeUfsDirRebuildFromSwapLog;
-static int storeUfsDirGetNextFile(RebuildState *, int *sfileno, int *size);
+static int storeUfsDirGetNextFile(RebuildState *, sfileno *, int *size);
 static StoreEntry *storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key,
     int file_number,
     size_t swap_file_sz,
@@ -126,9 +126,8 @@
  */
 
 static int
-storeUfsDirMapBitTest(SwapDir * SD, int fn)
+storeUfsDirMapBitTest(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     ufsinfo_t *ufsinfo;
     ufsinfo = (ufsinfo_t *) SD->fsdata;
     return file_map_bit_test(ufsinfo->map, filn);
@@ -378,7 +377,7 @@
     StoreEntry *e = NULL;
     StoreEntry tmpe;
     cache_key key[MD5_DIGEST_CHARS];
-    int sfileno = 0;
+    sfileno filn = 0;
     int count;
     int size;
     struct stat sb;
@@ -390,7 +389,7 @@
     debug(20, 3) ("storeUfsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index);
     for (count = 0; count < rb->speed; count++) {
 	assert(fd == -1);
-	fd = storeUfsDirGetNextFile(rb, &sfileno, &size);
+	fd = storeUfsDirGetNextFile(rb, &filn, &size);
 	if (fd == -2) {
 	    debug(20, 1) ("Done scanning %s swaplog (%d entries)\n",
 		rb->sd->path, rb->n_read);
@@ -415,7 +414,7 @@
 	if ((++rb->counts.scancount & 0xFFFF) == 0)
 	    debug(20, 3) ("  %s %7d files opened so far.\n",
 		rb->sd->path, rb->counts.scancount);
-	debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+	debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
 	statCounter.syscalls.disk.reads++;
 	if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
 	    debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n",
@@ -437,7 +436,7 @@
 	if (tlv_list == NULL) {
 	    debug(20, 1) ("storeUfsDirRebuildFromDirectory: failed to get meta data\n");
 	    /* XXX shouldn't this be a call to storeUfsUnlink ? */
-	    storeUfsDirUnlinkFile(SD, sfileno);
+	    storeUfsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	debug(20, 3) ("storeUfsDirRebuildFromDirectory: successful swap meta unpacking\n");
@@ -461,7 +460,7 @@
 	tlv_list = NULL;
 	if (storeKeyNull(key)) {
 	    debug(20, 1) ("storeUfsDirRebuildFromDirectory: NULL key\n");
-	    storeUfsDirUnlinkFile(SD, sfileno);
+	    storeUfsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	tmpe.hash.key = key;
@@ -473,11 +472,11 @@
 	} else if (tmpe.swap_file_sz != sb.st_size) {
 	    debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
 		tmpe.swap_file_sz, (int) sb.st_size);
-	    storeUfsDirUnlinkFile(SD, sfileno);
+	    storeUfsDirUnlinkFile(SD, filn);
 	    continue;
 	}
 	if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
-	    storeUfsDirUnlinkFile(SD, sfileno);
+	    storeUfsDirUnlinkFile(SD, filn);
 	    rb->counts.badflags++;
 	    continue;
 	}
@@ -496,7 +495,7 @@
 	rb->counts.objcount++;
 	storeEntryDump(&tmpe, 5);
 	e = storeUfsDirAddDiskRestore(SD, key,
-	    sfileno,
+	    filn,
 	    tmpe.swap_file_sz,
 	    tmpe.expires,
 	    tmpe.timestamp,
@@ -687,7 +686,7 @@
 }
 
 static int
-storeUfsDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
+storeUfsDirGetNextFile(RebuildState * rb, sfileno *filn_p, int *size)
 {
     SwapDir *SD = rb->sd;
     ufsinfo_t *ufsinfo = (ufsinfo_t *) SD->fsdata;
@@ -769,7 +768,7 @@
 	rb->curlvl1 = 0;
 	rb->done = 1;
     }
-    *sfileno = rb->fn;
+    *filn_p = rb->fn;
     return fd;
 }
 
