This patch is generated from the etc_hosts-20001231 branch of HEAD in squid
Thu Sep 11 11:57:47 2003 GMT
See http://devel.squid-cache.org/

Index: squid/CONTRIBUTORS
diff -u squid/CONTRIBUTORS:1.7 squid/CONTRIBUTORS:1.7.2.1
--- squid/CONTRIBUTORS:1.7	Wed Dec 20 08:03:33 2000
+++ squid/CONTRIBUTORS	Sat Dec 30 01:51:42 2000
@@ -72,6 +72,7 @@
 	John Dilley <jad@hpl.hp.com>
 	Adrian Chadd <adrian@creative.net.au>
 	Robert Collins <robert.collins@itdomain.com.au>
+	Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
 	Brian Degenhardt <bmd@mp3.com>
 	Evan Jones <ejones@uwaterloo.ca>
 	Scott Schram <scott@schram.net>
Index: squid/src/cf.data.pre
diff -u squid/src/cf.data.pre:1.6 squid/src/cf.data.pre:1.6.2.1
--- squid/src/cf.data.pre:1.6	Tue Dec 19 08:43:06 2000
+++ squid/src/cf.data.pre	Sat Dec 30 01:06:26 2000
@@ -1017,6 +1017,29 @@
 	Example: dns_nameservers 10.0.0.1 192.172.0.4
 DOC_END
 
+NAME: hosts_file
+TYPE: string
+DEFAULT: /etc/hosts
+LOC: Config.etcHostsFile
+DOC_START
+	Location of the host-local IP name-address associations database.
+	Most Operating Systems have such a file:
+	under Un*X it's by default in /etc/hosts
+	MS-Windows NT/2000 places that in 
+	%SystemRoot%(by default c:\winnt)\system32\drivers\etc\hosts,
+	while Windows 9x/ME places that in
+	%windir%(usually c:\windows)\hosts
+
+	The file contains newline-separated definitions, in the form
+	ip_address_in_dotted_form name [name ...]
+	names are whitespace-separated.
+	lines beginnng with an hash (#) character are comments.
+
+	The file is checked at startup and upon configuration.
+	If set to 'none', it won't be checked.
+	If append_domain is used, that domain will be added to domain-local
+	(i.e. not containing any dot character) host definitions.
+DOC_END
 
 NAME: unlinkd_program
 IFDEF: USE_UNLINKD
Index: squid/src/fqdncache.c
diff -u squid/src/fqdncache.c:1.5 squid/src/fqdncache.c:1.5.8.1
--- squid/src/fqdncache.c:1.5	Tue Dec 12 15:21:19 2000
+++ squid/src/fqdncache.c	Sat Dec 30 01:15:19 2000
@@ -54,6 +54,7 @@
     unsigned short locks;
     struct {
 	unsigned int negcached:1;
+	unsigned int fromhosts:1;
     } flags;
 };
 
@@ -125,11 +126,12 @@
 static int
 fqdncacheExpiredEntry(const fqdncache_entry * f)
 {
-    if (f->locks != 0)
-	return 0;
-    if (f->expires > squid_curtime)
-	return 0;
-    return 1;
+	/* all static entries are locked, so this takes care of them too */
+	if (f->locks != 0)
+		return 0;
+	if (f->expires > squid_curtime)
+		return 0;
+	return 1;
 }
 
 void
@@ -153,6 +155,26 @@
     debug(35, 9) ("fqdncache_purgelru: removed %d entries\n", removed);
 }
 
+/* purges entries added from /etc/hosts (or whatever). */
+static void purge_entries_fromhosts (void) {
+	dlink_node *m=lru_list.head;
+	fqdncache_entry *i=NULL, *t;
+	
+	while (m) {
+		if (i!=NULL) {              /* need to delay deletion */
+			fqdncacheRelease(i);			/* we just override locks */
+			i=NULL;
+		}
+		t=(fqdncache_entry *)m->data;
+		if (t->flags.fromhosts)
+			i=t;
+		m=m->next;
+	}
+	if (i!=NULL)
+		fqdncacheRelease(i);
+}
+
+
 /* create blank fqdncache_entry */
 static fqdncache_entry *
 fqdncacheCreateEntry(const char *name)
@@ -436,38 +458,41 @@
 void
 fqdnStats(StoreEntry * sentry)
 {
-    fqdncache_entry *f = NULL;
-    int k;
-    int ttl;
-    if (fqdn_table == NULL)
-	return;
-    storeAppendPrintf(sentry, "FQDN Cache Statistics:\n");
-    storeAppendPrintf(sentry, "FQDNcache Entries: %d\n",
-	memInUse(MEM_FQDNCACHE_ENTRY));
-    storeAppendPrintf(sentry, "FQDNcache Requests: %d\n",
-	FqdncacheStats.requests);
-    storeAppendPrintf(sentry, "FQDNcache Hits: %d\n",
-	FqdncacheStats.hits);
-    storeAppendPrintf(sentry, "FQDNcache Negative Hits: %d\n",
-	FqdncacheStats.negative_hits);
-    storeAppendPrintf(sentry, "FQDNcache Misses: %d\n",
-	FqdncacheStats.misses);
-    storeAppendPrintf(sentry, "Blocking calls to gethostbyaddr(): %d\n",
-	FqdncacheStats.ghba_calls);
-    storeAppendPrintf(sentry, "FQDN Cache Contents:\n\n");
-
-    hash_first(fqdn_table);
-    while ((f = (fqdncache_entry *) hash_next(fqdn_table))) {
-	ttl = (f->expires - squid_curtime);
-	storeAppendPrintf(sentry, " %-32.32s %c %6d %d",
-	    hashKeyStr(&f->hash),
-	    f->flags.negcached ? 'N' : ' ',
-	    ttl,
-	    (int) f->name_count);
-	for (k = 0; k < (int) f->name_count; k++)
+	fqdncache_entry *f = NULL;
+	int k;
+	int ttl;
+	if (fqdn_table == NULL)
+		return;
+	storeAppendPrintf(sentry, "FQDN Cache Statistics:\n");
+	storeAppendPrintf(sentry, "FQDNcache Entries: %d\n",
+										memInUse(MEM_FQDNCACHE_ENTRY));
+	storeAppendPrintf(sentry, "FQDNcache Requests: %d\n",
+										FqdncacheStats.requests);
+	storeAppendPrintf(sentry, "FQDNcache Hits: %d\n",
+										FqdncacheStats.hits);
+	storeAppendPrintf(sentry, "FQDNcache Negative Hits: %d\n",
+										FqdncacheStats.negative_hits);
+	storeAppendPrintf(sentry, "FQDNcache Misses: %d\n",
+										FqdncacheStats.misses);
+	storeAppendPrintf(sentry, "Blocking calls to gethostbyaddr(): %d\n",
+										FqdncacheStats.ghba_calls);
+	storeAppendPrintf(sentry, "FQDN Cache Contents:\n\n");
+	
+	storeAppendPrintf(sentry, "%-15.15s %3s %3s %3s %s\n",
+										"Address","Flg","TTL","Cnt","Hostnames");
+	hash_first(fqdn_table);
+	while ((f = (fqdncache_entry *) hash_next(fqdn_table))) {
+		ttl = (f->flags.fromhosts?-1:(f->expires - squid_curtime));
+		storeAppendPrintf(sentry, "%-15.15s  %c%c %3.3d % 3d",
+											hashKeyStr(&f->hash),
+											f->flags.negcached ? 'N' : ' ',
+											f->flags.fromhosts ? 'H' : ' ',
+											ttl,
+											(int) f->name_count);
+		for (k = 0; k < (int) f->name_count; k++)
 	    storeAppendPrintf(sentry, " %s", f->names[k]);
-	storeAppendPrintf(sentry, "\n");
-    }
+		storeAppendPrintf(sentry, "\n");
+	}
 }
 
 static void
@@ -533,6 +558,43 @@
 	    (float) FQDN_HIGH_WATER) / (float) 100);
     fqdncache_low = (long) (((float) Config.fqdncache.size *
 	    (float) FQDN_LOW_WATER) / (float) 100);
+		purge_entries_fromhosts();
+}
+
+
+/* adds a "static" entry from /etc/hosts */
+/* the worldist is to be managed by the caller, including pointed-to strings */
+void fqdncacheAddEntryFromHosts (char *addr, wordlist *hostnames) {
+	fqdncache_entry *fce;
+	int j=0;
+	
+	if ((fce=fqdncache_get(addr))) {
+		if (fce->flags.fromhosts==1) {
+			fqdncacheUnlockEntry(fce);
+		} else {
+			if (fce->locks > 0) {
+				debug(35,1)("fqdncacheAddEntryFromHosts: can't add static entry for "
+										"locked address '%s'\n", addr);
+				return;
+			} else {
+				fqdncacheRelease(fce);
+			}
+		}
+	}
+
+	fce=fqdncacheCreateEntry(addr);
+	while (hostnames) {
+		fce->names[j]=xstrdup(hostnames->key);
+		j++;
+		hostnames=hostnames->next;
+		if (j >= FQDN_MAX_NAMES)
+			break;
+	}
+	fce->name_count=j;
+	fce->names[j]=NULL;						/* it's safe */
+	fce->flags.fromhosts=1;
+	fqdncacheAddEntry(fce);
+	fqdncacheLockEntry(fce);
 }
 
 #ifdef SQUID_SNMP
Index: squid/src/ipcache.c
diff -u squid/src/ipcache.c:1.4 squid/src/ipcache.c:1.4.18.1
--- squid/src/ipcache.c:1.4	Fri Nov  3 00:39:20 2000
+++ squid/src/ipcache.c	Sat Dec 30 01:24:58 2000
@@ -49,7 +49,8 @@
     dlink_node lru;
     unsigned short locks;
     struct {
-	unsigned int negcached:1;
+			unsigned int negcached:1;
+			unsigned int fromhosts:1;		/* got from /etc/hosts */
     } flags;
 };
 
@@ -85,6 +86,7 @@
 static void ipcacheStatPrint(ipcache_entry *, StoreEntry *);
 static void ipcacheUnlockEntry(ipcache_entry *);
 static void ipcacheRelease(ipcache_entry *);
+static void purge_entries_fromhosts (void);
 
 static ipcache_addrs static_addrs;
 static hash_table *ip_table = NULL;
@@ -132,14 +134,15 @@
 static int
 ipcacheExpiredEntry(ipcache_entry * i)
 {
-    if (i->locks != 0)
-	return 0;
-    if (i->addrs.count == 0)
-	if (0 == i->flags.negcached)
+	/* all static entries are locked, so this takes care of them too */
+	if (i->locks != 0)
+		return 0;
+	if (i->addrs.count == 0)
+		if (0 == i->flags.negcached)
 	    return 1;
-    if (i->expires > squid_curtime)
-	return 0;
-    return 1;
+	if (i->expires > squid_curtime)
+		return 0;
+	return 1;
 }
 
 void
@@ -269,7 +272,7 @@
 	i.addrs.in_addrs = xcalloc(ipcount, sizeof(struct in_addr));
 	i.addrs.bad_mask = xcalloc(ipcount, sizeof(unsigned char));
     }
-    for (j = 0, k = 0; k < ipcount; k++) {
+    for (j = 0, k = 0; k < ipcount; k++) { /* memory wasted here. Kinkie */
 	if (safe_inet_addr(A[k], &i.addrs.in_addrs[j]))
 	    j++;
 	else
@@ -487,11 +490,12 @@
 ipcacheStatPrint(ipcache_entry * i, StoreEntry * sentry)
 {
     int k;
-    storeAppendPrintf(sentry, " %-32.32s  %c %6d %6d %2d(%2d)",
+    storeAppendPrintf(sentry, " %-32.32s %c%c %6d %6d %2d(%2d)",
 	hashKeyStr(&i->hash),
 	i->flags.negcached ? 'N' : ' ',
+	i->flags.fromhosts ? 'H' : ' ',
 	(int) (squid_curtime - i->lastref),
-	(int) (i->expires - squid_curtime),
+	(int) ((i->flags.fromhosts ? -1 : (i->expires - squid_curtime)),
 	(int) i->addrs.count,
 	(int) i->addrs.badcount);
     for (k = 0; k < (int) i->addrs.count; k++) {
@@ -524,7 +528,7 @@
 	IpcacheStats.release_locked);
     storeAppendPrintf(sentry, "\n\n");
     storeAppendPrintf(sentry, "IP Cache Contents:\n\n");
-    storeAppendPrintf(sentry, " %-29.29s %3s %6s %6s %1s\n",
+    storeAppendPrintf(sentry, " %-31.31s %3s %6s %6s %1s\n",
 	"Hostname",
 	"Flg",
 	"lstref",
@@ -534,6 +538,24 @@
 	ipcacheStatPrint(m->data, sentry);
 }
 
+static void purge_entries_fromhosts (void) {
+	dlink_node *m=lru_list.head;
+	ipcache_entry *i=NULL, *t;
+
+	while (m) {
+		if (i!=NULL) {							/* need to delay deletion */
+			ipcacheRelease(i);
+			i=NULL;
+		}
+		t=(ipcache_entry *)m->data;
+		if (t->flags.fromhosts)
+			i=t;
+		m=m->next;
+	}
+	if (i!=NULL)
+		ipcacheRelease(i);
+}
+
 static void
 dummy_handler(const ipcache_addrs * addrsnotused, void *datanotused)
 {
@@ -694,7 +716,50 @@
 	    (float) Config.ipcache.high) / (float) 100);
     ipcache_low = (long) (((float) Config.ipcache.size *
 	    (float) Config.ipcache.low) / (float) 100);
+		purge_entries_fromhosts();
 }
+
+/* this is used to add static entries from /etc/hosts */
+/* returns 0 upon success, 1 if the ip address is invalid */
+int ipcacheAddEntryFromHosts(char *name, char *ip_address) {
+	ipcache_entry *ice;
+
+	if ((ice=ipcache_get(name))) {
+		if (ice->flags.fromhosts==1) {
+			ipcacheRelease(ice);
+		} else {
+			if (ice->locks > 0) {
+				/* actually this should never happen ... */
+				debug(14,1)("ipcacheAddEntryFromHosts: can't add static entry for "
+										"locked host '%s'\n",
+										name);
+				return 1;
+			}	else {
+				ipcacheRelease(ice);
+			}
+		}
+	}
+		
+	ice=ipcacheCreateEntry(name);
+	ice->addrs.in_addrs=xmalloc(sizeof(struct in_addr));
+	if (!safe_inet_addr(ip_address,&ice->addrs.in_addrs[0])) {
+		/* not a valid address */
+		debug(14,1)("ipcacheAddStaticEntry: address '%s' is "
+								"not a valid IP address",
+								ip_address);
+		xfree(ice->addrs.in_addrs);
+		memFree(ice,MEM_IPCACHE_ENTRY);
+		return 1;
+	}
+	ice->addrs.bad_mask=xmalloc(sizeof(unsigned char));
+	ice->addrs.bad_mask[0]=0;
+	ice->addrs.count=1;
+	ice->flags.fromhosts=1;
+	ipcacheAddEntry(ice);
+	ipcacheLockEntry(ice);
+	return 0;
+}
+
 
 #ifdef SQUID_SNMP
 /*
Index: squid/src/main.c
diff -u squid/src/main.c:1.6 squid/src/main.c:1.6.8.1
--- squid/src/main.c:1.6	Tue Dec 12 15:21:19 2000
+++ squid/src/main.c	Sat Dec 30 01:29:30 2000
@@ -73,6 +73,8 @@
 static void mainSetCwd(void);
 static int checkRunningPid(void);
 
+static void parse_etc_hosts(void);
+
 static const char *squid_start_script = "squid_start";
 
 #if TEST_ACCESS
@@ -351,6 +353,7 @@
     _db_init(Config.Log.log, Config.debugOptions);
     ipcache_restart();		/* clear stuck entries */
     fqdncache_restart();	/* sigh, fqdncache too */
+    parse_etc_hosts();
     errorInitialize();		/* reload error pages */
 #if USE_DNSSERVERS
     dnsInit();
@@ -482,6 +485,7 @@
 	disk_init();		/* disk_init must go before ipcache_init() */
     ipcache_init();
     fqdncache_init();
+    parse_etc_hosts();
 #if USE_DNSSERVERS
     dnsInit();
 #else
@@ -988,4 +992,57 @@
     if (debug_log)
 	fclose(debug_log);
     exit(0);
+}
+/* MUST be called AFTER ip- and fqdn- cache_init */
+static void parse_etc_hosts(void) {
+	FILE *fp;
+	char buf[1024], buf2[512];
+	char *nt=buf, *lt=buf, *addr=buf, *host=NULL;
+
+	if (Config.etcHostsFile == NULL || strcmp(Config.etcHostsFile,"none")==0)
+		return;
+	
+	fp=fopen(Config.etcHostsFile,"r");
+	if (fp==NULL) {
+		debug(1,1) ("etc_hosts(%s): %s\n", Config.etcHostsFile, xstrerror());
+		return;
+	}
+	while (fgets(buf,10240,fp)) {	/* for each line */
+		wordlist *hosts=NULL;
+		if (buf[0]=='#') /* MS-windows likes to add comments */
+			continue;
+		lt=buf;
+		addr=buf;
+		debug(1,5)("etc_hosts: line is '%s'\n",buf);
+		nt=strpbrk(lt,w_space);
+		if (nt==NULL) {							/* empty line */
+			continue;
+		}
+		*nt='\0'; /* null-terminate the address */
+		debug(1,5)("etc_hosts: address is '%s'\n",addr);
+		lt=nt+1;
+		while ( (nt=strpbrk(lt,w_space)) ) {
+			if (nt-lt==1) {						/* multiple spaces */
+				debug(1,5)("etc_hosts: multiple spaces, skipping\n");
+				lt=nt+1;
+				continue;
+			}
+			*nt='\0';
+			debug(1,5)("etc_hosts: got hostname '%s'\n",lt);
+			if (Config.appendDomain && !strchr(lt,'.')) {
+				strncpy(buf2,lt,512); /* I know it's ugly, but it's only at reconfig */
+				strncat(buf2,Config.appendDomain,512-strlen(lt));
+				host=buf2;
+			} else {
+				host=lt;
+			}
+
+			wordlistAdd(&hosts,host);
+			if (ipcacheAddEntryFromHosts(host,addr)!=0)
+				continue; /* invalid address, continuing is useless */
+			lt=nt+1;
+		}
+		fqdncacheAddEntryFromHosts(addr,hosts);
+		wordlistDestroy(&hosts);
+	}
 }
Index: squid/src/protos.h
diff -u squid/src/protos.h:1.6 squid/src/protos.h:1.6.8.1
--- squid/src/protos.h:1.6	Tue Dec 12 15:21:19 2000
+++ squid/src/protos.h	Sat Dec 30 01:35:21 2000
@@ -558,6 +558,7 @@
 extern void ipcacheFreeMemory(void);
 extern ipcache_addrs *ipcacheCheckNumeric(const char *name);
 extern void ipcache_restart(void);
+extern int ipcacheAddEntryFromHosts(char *name, char *ip_address);
 
 /* MemBuf */
 /* init with specific sizes */
Index: squid/src/structs.h
diff -u squid/src/structs.h:1.8 squid/src/structs.h:1.8.10.1
--- squid/src/structs.h:1.8	Tue Dec 12 15:21:20 2000
+++ squid/src/structs.h	Sat Dec 30 01:33:38 2000
@@ -220,303 +220,305 @@
 };
 
 struct _SquidConfig {
-    struct {
-	size_t maxSize;
-	int highWaterMark;
-	int lowWaterMark;
-    } Swap;
-    size_t memMaxSize;
-    struct {
-	char *relayHost;
-	u_short relayPort;
-	peer *peer;
-    } Wais;
-    struct {
-	size_t min;
-	int pct;
-	size_t max;
-    } quickAbort;
-    RemovalPolicySettings *replPolicy;
-    RemovalPolicySettings *memPolicy;
-    time_t referenceAge;
-    time_t negativeTtl;
-    time_t negativeDnsTtl;
-    time_t positiveDnsTtl;
-    time_t shutdownLifetime;
-    struct {
-	time_t read;
-	time_t lifetime;
-	time_t connect;
-	time_t peer_connect;
-	time_t request;
-	time_t pconn;
-	time_t siteSelect;
-	time_t deadPeer;
-	int icp_query;		/* msec */
-	int icp_query_max;	/* msec */
-	int mcast_icp_query;	/* msec */
+	struct {
+		size_t maxSize;
+		int highWaterMark;
+		int lowWaterMark;
+	} Swap;
+	size_t memMaxSize;
+	struct {
+		char *relayHost;
+		u_short relayPort;
+		peer *peer;
+	} Wais;
+	struct {
+		size_t min;
+		int pct;
+		size_t max;
+	} quickAbort;
+	RemovalPolicySettings *replPolicy;
+	RemovalPolicySettings *memPolicy;
+	time_t referenceAge;
+	time_t negativeTtl;
+	time_t negativeDnsTtl;
+	time_t positiveDnsTtl;
+	time_t shutdownLifetime;
+	struct {
+		time_t read;
+		time_t lifetime;
+		time_t connect;
+		time_t peer_connect;
+		time_t request;
+		time_t pconn;
+		time_t siteSelect;
+		time_t deadPeer;
+		int icp_query;		/* msec */
+		int icp_query_max;	/* msec */
+		int mcast_icp_query;	/* msec */
 #if USE_IDENT
-	time_t ident;
+		time_t ident;
 #endif
 #if !USE_DNSSERVERS
-	time_t idns_retransmit;
-	time_t idns_query;
+		time_t idns_retransmit;
+		time_t idns_query;
 #endif
-    } Timeout;
-    size_t maxRequestHeaderSize;
-    size_t maxRequestBodySize;
-    size_t maxReplyBodySize;
-    struct {
-	u_short icp;
+	} Timeout;
+	size_t maxRequestHeaderSize;
+	size_t maxRequestBodySize;
+	size_t maxReplyBodySize;
+	struct {
+		u_short icp;
 #if USE_HTCP
-	u_short htcp;
+		u_short htcp;
 #endif
 #if SQUID_SNMP
-	u_short snmp;
+		u_short snmp;
 #endif
-    } Port;
-    struct {
-	sockaddr_in_list *http;
-    } Sockaddr;
+	} Port;
+	struct {
+		sockaddr_in_list *http;
+	} Sockaddr;
 #if SQUID_SNMP
-    struct {
-	char *configFile;
-	char *agentInfo;
-    } Snmp;
+	struct {
+		char *configFile;
+		char *agentInfo;
+	} Snmp;
 #endif
 #if USE_WCCP
-    struct {
-	struct in_addr router;
-	struct in_addr incoming;
-	struct in_addr outgoing;
-	int version;
-    } Wccp;
-#endif
-    char *as_whois_server;
-    struct {
-	char *log;
-	char *access;
-	char *store;
-	char *swap;
+	struct {
+		struct in_addr router;
+		struct in_addr incoming;
+		struct in_addr outgoing;
+		int version;
+	} Wccp;
+#endif
+	char *as_whois_server;
+	struct {
+		char *log;
+		char *access;
+		char *store;
+		char *swap;
 #if USE_USERAGENT_LOG
-	char *useragent;
+		char *useragent;
 #endif
 #if USE_REFERER_LOG
-	char *referer;
+		char *referer;
 #endif
 #if WIP_FWD_LOG
-	char *forward;
+		char *forward;
 #endif
-	int rotateNumber;
-    } Log;
-    char *adminEmail;
-    char *effectiveUser;
-    char *effectiveGroup;
-    struct {
+		int rotateNumber;
+	} Log;
+	char *adminEmail;
+	char *effectiveUser;
+	char *effectiveGroup;
+	struct {
 #if USE_DNSSERVERS
-	char *dnsserver;
+		char *dnsserver;
 #endif
-	wordlist *redirect;
-	wordlist *authenticate;
+		wordlist *redirect;
+		wordlist *authenticate;
 #if USE_ICMP
-	char *pinger;
+		char *pinger;
 #endif
 #if USE_UNLINKD
-	char *unlinkd;
+		char *unlinkd;
 #endif
-    } Program;
+	} Program;
 #if USE_DNSSERVERS
-    int dnsChildren;
+	int dnsChildren;
 #endif
-    int redirectChildren;
-    int authenticateChildren;
-    time_t authenticateTTL;
-    time_t authenticateIpTTL;
-    struct {
-	int single_host;
-	char *host;
-	u_short port;
-    } Accel;
-    char *appendDomain;
-    size_t appendDomainLen;
-    char *debugOptions;
-    char *pidFilename;
-    char *mimeTablePathname;
-    char *visibleHostname;
-    char *uniqueHostname;
-    wordlist *hostnameAliases;
-    char *errHtmlText;
-    struct {
-	char *host;
-	char *file;
-	time_t period;
-	u_short port;
-    } Announce;
-    struct {
-	struct in_addr tcp_outgoing;
-	struct in_addr udp_incoming;
-	struct in_addr udp_outgoing;
+	int redirectChildren;
+	int authenticateChildren;
+	time_t authenticateTTL;
+	time_t authenticateIpTTL;
+	struct {
+		int single_host;
+		char *host;
+		u_short port;
+	} Accel;
+	char *appendDomain;
+	size_t appendDomainLen;
+	char *etcHostsFile;
+	char *debugOptions;
+	char *pidFilename;
+	char *mimeTablePathname;
+	char *visibleHostname;
+	char *uniqueHostname;
+	wordlist *hostnameAliases;
+	char *errHtmlText;
+	struct {
+		char *host;
+		char *file;
+		time_t period;
+		u_short port;
+	} Announce;
+	struct {
+		struct in_addr tcp_outgoing;
+		struct in_addr udp_incoming;
+		struct in_addr udp_outgoing;
 #if SQUID_SNMP
-	struct in_addr snmp_incoming;
-	struct in_addr snmp_outgoing;
+		struct in_addr snmp_incoming;
+		struct in_addr snmp_outgoing;
 #endif
-	struct in_addr client_netmask;
-    } Addrs;
-    size_t tcpRcvBufsz;
-    size_t udpMaxHitObjsz;
-    wordlist *hierarchy_stoplist;
-    wordlist *mcast_group_list;
-    wordlist *dns_testname_list;
-    wordlist *dns_nameservers;
-    peer *peers;
-    int npeers;
-    struct {
-	int size;
-	int low;
-	int high;
-    } ipcache;
-    struct {
-	int size;
-    } fqdncache;
-    int minDirectHops;
-    cachemgr_passwd *passwd_list;
-    struct {
-	int objectsPerBucket;
-	size_t avgObjectSize;
-	size_t maxObjectSize;
-	size_t minObjectSize;
-	size_t maxInMemObjSize;
-    } Store;
-    struct {
-	int high;
-	int low;
-	time_t period;
-    } Netdb;
-    struct {
-	int log_udp;
+		struct in_addr client_netmask;
+	} Addrs;
+	size_t tcpRcvBufsz;
+	size_t udpMaxHitObjsz;
+	wordlist *hierarchy_stoplist;
+	wordlist *mcast_group_list;
+	wordlist *dns_testname_list;
+	wordlist *dns_nameservers;
+	
+	peer *peers;
+	int npeers;
+	struct {
+		int size;
+		int low;
+		int high;
+	} ipcache;
+	struct {
+		int size;
+	} fqdncache;
+	int minDirectHops;
+	cachemgr_passwd *passwd_list;
+	struct {
+		int objectsPerBucket;
+		size_t avgObjectSize;
+		size_t maxObjectSize;
+		size_t minObjectSize;
+		size_t maxInMemObjSize;
+	} Store;
+	struct {
+		int high;
+		int low;
+		time_t period;
+	} Netdb;
+	struct {
+		int log_udp;
 #if USE_DNSSERVERS
-	int res_defnames;
+		int res_defnames;
 #endif
-	int anonymizer;
-	int client_db;
-	int query_icmp;
-	int icp_hit_stale;
-	int buffered_logs;
+		int anonymizer;
+		int client_db;
+		int query_icmp;
+		int icp_hit_stale;
+		int buffered_logs;
 #if ALLOW_SOURCE_PING
-	int source_ping;
+		int source_ping;
 #endif
-	int common_log;
-	int log_mime_hdrs;
-	int log_fqdn;
-	int announce;
-	int accel_with_proxy;
-	int mem_pools;
-	int test_reachability;
-	int half_closed_clients;
+		int common_log;
+		int log_mime_hdrs;
+		int log_fqdn;
+		int announce;
+		int accel_with_proxy;
+		int mem_pools;
+		int test_reachability;
+		int half_closed_clients;
 #if HTTP_VIOLATIONS
-	int reload_into_ims;
+		int reload_into_ims;
 #endif
-	int offline;
-	int redir_rewrites_host;
-	int prefer_direct;
-	int nonhierarchical_direct;
-	int strip_query_terms;
-	int redirector_bypass;
-	int ignore_unknown_nameservers;
-	int client_pconns;
-	int server_pconns;
+		int offline;
+		int redir_rewrites_host;
+		int prefer_direct;
+		int nonhierarchical_direct;
+		int strip_query_terms;
+		int redirector_bypass;
+		int ignore_unknown_nameservers;
+		int client_pconns;
+		int server_pconns;
 #if USE_CACHE_DIGESTS
-	int digest_generation;
+		int digest_generation;
 #endif
-	int log_ip_on_direct;
-	int authenticateIpTTLStrict;
-	int ie_refresh;
-    } onoff;
-    acl *aclList;
-    struct {
-	acl_access *http;
-	acl_access *icp;
-	acl_access *miss;
-	acl_access *NeverDirect;
-	acl_access *AlwaysDirect;
-	acl_access *ASlists;
-	acl_access *noCache;
+		int log_ip_on_direct;
+		int authenticateIpTTLStrict;
+		int ie_refresh;
+	} onoff;
+	acl *aclList;
+	struct {
+		acl_access *http;
+		acl_access *icp;
+		acl_access *miss;
+		acl_access *NeverDirect;
+		acl_access *AlwaysDirect;
+		acl_access *ASlists;
+		acl_access *noCache;
 #if SQUID_SNMP
-	acl_access *snmp;
+		acl_access *snmp;
 #endif
-	acl_access *brokenPosts;
+		acl_access *brokenPosts;
 #if USE_IDENT
-	acl_access *identLookup;
+		acl_access *identLookup;
 #endif
-	acl_access *redirector;
-    } accessList;
-    acl_deny_info_list *denyInfoList;
-    char *proxyAuthRealm;
-    struct {
-	size_t list_width;
-	int list_wrap;
-	char *anon_user;
-	int passive;
-    } Ftp;
-    refresh_t *Refresh;
-    struct _cacheSwap {
-	SwapDir *swapDirs;
-	int n_allocated;
-	int n_configured;
-    } cacheSwap;
-    char *fake_ua;
-    struct {
-	char *directory;
-    } icons;
-    char *errorDirectory;
-    struct {
-	time_t timeout;
-	int maxtries;
-    } retry;
-    struct {
-	size_t limit;
-    } MemPools;
+		acl_access *redirector;
+	} accessList;
+	acl_deny_info_list *denyInfoList;
+	char *proxyAuthRealm;
+	struct {
+		size_t list_width;
+		int list_wrap;
+		char *anon_user;
+		int passive;
+	} Ftp;
+	refresh_t *Refresh;
+	struct _cacheSwap {
+		SwapDir *swapDirs;
+		int n_allocated;
+		int n_configured;
+	} cacheSwap;
+	char *fake_ua;
+	struct {
+		char *directory;
+	} icons;
+	char *errorDirectory;
+	struct {
+		time_t timeout;
+		int maxtries;
+	} retry;
+	struct {
+		size_t limit;
+	} MemPools;
 #if DELAY_POOLS
-    delayConfig Delay;
+	delayConfig Delay;
 #endif
-    struct {
-	int icp_average;
-	int dns_average;
-	int http_average;
-	int icp_min_poll;
-	int dns_min_poll;
-	int http_min_poll;
-    } comm_incoming;
-    int max_open_disk_fds;
-    int uri_whitespace;
-    size_t rangeOffsetLimit;
+	struct {
+		int icp_average;
+		int dns_average;
+		int http_average;
+		int icp_min_poll;
+		int dns_min_poll;
+		int http_min_poll;
+	} comm_incoming;
+	int max_open_disk_fds;
+	int uri_whitespace;
+	size_t rangeOffsetLimit;
 #if MULTICAST_MISS_STREAM
-    struct {
-	struct in_addr addr;
-	int ttl;
-	unsigned short port;
-	char *encode_key;
-    } mcast_miss;
-#endif
-    HttpHeaderMask anonymize_headers;
-    char *coredump_dir;
-    char *chroot_dir;
+	struct {
+		struct in_addr addr;
+		int ttl;
+		unsigned short port;
+		char *encode_key;
+	} mcast_miss;
+#endif
+	HttpHeaderMask anonymize_headers;
+	char *coredump_dir;
+	char *chroot_dir;
 #if USE_CACHE_DIGESTS
-    struct {
-	int bits_per_entry;
-	time_t rebuild_period;
-	time_t rewrite_period;
-	size_t swapout_chunk_size;
-	int rebuild_chunk_percentage;
-    } digest;
-#endif
-    wordlist *ext_methods;
-    struct {
-	int high_rptm;
-	int high_pf;
-	size_t high_memory;
-    } warnings;
-    char *store_dir_select_algorithm;
+	struct {
+		int bits_per_entry;
+		time_t rebuild_period;
+		time_t rewrite_period;
+		size_t swapout_chunk_size;
+		int rebuild_chunk_percentage;
+	} digest;
+#endif
+	wordlist *ext_methods;
+	struct {
+		int high_rptm;
+		int high_pf;
+		size_t high_memory;
+	} warnings;
+	char *store_dir_select_algorithm;
 };
 
 struct _SquidConfig2 {
squid-etc_hosts-20001231-HEAD.new squid-etc_hosts-20001231-HEAD differ: char 78, line 2
