=== modified file 'configure.ac' --- configure.ac 2011-12-01 06:31:39 +0000 +++ configure.ac 2012-01-01 13:15:00 +0000 @@ -1588,19 +1588,19 @@ AC_MSG_NOTICE([Support for Ident lookups enabled: ${enable_ident_lookups:=yes}]) SQUID_DEFINE_BOOL(USE_IDENT,$enable_ident_lookups,[Support for Ident (RFC 931) lookups]) -squid_opt_use_dnsserver="no" +squid_opt_use_dnshelper="no" AC_ARG_ENABLE(internal-dns, AS_HELP_STRING([--disable-internal-dns], [Prevents Squid from directly sending and receiving DNS messages, and instead enables the old external 'dnsserver' processes.]), [ if test "x$enableval" = "xno" ; then AC_MSG_WARN([Disabling Internal DNS queries]) - squid_opt_use_dnsserver="yes" + squid_opt_use_dnshelper="yes" fi ]) -SQUID_DEFINE_BOOL(USE_DNSSERVERS,$squid_opt_use_dnsserver, +SQUID_DEFINE_BOOL(USE_DNSHELPER,$squid_opt_use_dnshelper, [Use dnsserver processes instead of the internal DNS protocol support]) -AM_CONDITIONAL([USE_DNSSERVER],[test "x$squid_opt_use_dnsserver" = "xyes" ]) +AM_CONDITIONAL([ENABLE_DNSHELPER],[test "x$squid_opt_use_dnshelper" = "xyes" ]) AM_CONDITIONAL(USE_SSL_CRTD, false) @@ -3386,7 +3386,7 @@ SQUID_CHECK_NEED_SYS_ERRLIST SQUID_CHECK_MAXPATHLEN -if test "x$squid_opt_use_dnsserver" = "xyes"; then +if test "x$squid_opt_use_dnshelper" = "xyes"; then SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK SQUID_CHECK_RESOLVER_FIELDS fi === modified file 'squid3.dox' --- squid3.dox 2011-08-20 01:55:49 +0000 +++ squid3.dox 2011-12-31 05:41:07 +0000 @@ -1266,7 +1266,7 @@ USE_CLASSFUL \ USE_DELAY_POOLS \ USE_DLMALLOC \ - USE_DNSSERVERS \ + USE_DNSHELPER \ USE_EPOLL \ USE_GNUREGEX \ USE_HEXDUMP \ === modified file 'src/Makefile.am' --- src/Makefile.am 2012-01-01 04:48:49 +0000 +++ src/Makefile.am 2012-01-01 05:53:01 +0000 @@ -7,15 +7,17 @@ include $(top_srcdir)/src/Common.am AUTOMAKE_OPTIONS = subdir-objects -if USE_DNSSERVER + +if ENABLE_DNSHELPER DNSSOURCE = dns.cc -DNSSERVER = dnsserver +DNSHELPER = dnsserver else DNSSOURCE = dns_internal.cc -DNSSERVER = +DNSHELPER = endif DNSSOURCE += \ + SquidDns.h \ DnsLookupDetails.h \ DnsLookupDetails.cc @@ -203,7 +205,7 @@ libexec_PROGRAMS = \ - $(DNSSERVER) \ + $(DNSHELPER) \ $(DISK_PROGRAMS) \ $(UNLINKD) @@ -636,7 +638,6 @@ ## dnsserver is a standalone helper. Do not link to any internal libraries dnsserver_SOURCES = dnsserver.cc -## SquidNew.cc tests/stub_debug.cc test_tools.cc time.cc dnsserver_LDADD = $(COMPAT_LIB) recv_announce_SOURCES = recv-announce.cc === added file 'src/SquidDns.h' --- src/SquidDns.h 1970-01-01 00:00:00 +0000 +++ src/SquidDns.h 2012-01-01 13:16:15 +0000 @@ -0,0 +1,21 @@ +#ifndef SQUID_DNS_H +#define SQUID_DNS_H + +namespace Ip { +class Address; +} + +// generic DNS API +extern void dnsInit(void); +extern void dnsShutdown(void); + +#if USE_DNSHELPER +// external DNS helper API +extern void dnsSubmit(const char *lookup, HLPCB * callback, void *data); +#else +// internal DNS client API +extern void idnsALookup(const char *, IDNSCB *, void *); +extern void idnsPTRLookup(const Ip::Address &, IDNSCB *, void *); +#endif + +#endif /* SQUID_DNS_H */ === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2011-12-19 03:51:22 +0000 +++ src/cache_cf.cc 2011-12-31 05:40:49 +0000 @@ -161,7 +161,7 @@ #if USE_SSL static void parseBytesOptionValue(size_t * bptr, const char *units, char const * value); #endif -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void parseBytesLineSigned(ssize_t * bptr, const char *units); #endif static size_t parseBytesUnits(const char *unit); @@ -639,11 +639,9 @@ else visible_appname_string = (char const *)APP_FULLNAME; -#if USE_DNSSERVERS - +#if USE_DNSHELPER if (Config.dnsChildren.n_max < 1) - fatal("No dnsservers allocated"); - + fatal("No DNS helpers allocated"); #endif if (Config.Program.redirect) { @@ -704,8 +702,7 @@ } requirePathnameExists("MIME Config Table", Config.mimeTablePathname); -#if USE_DNSSERVERS - +#if USE_DNSHELPER requirePathnameExists("cache_dns_program", Config.Program.dnsserver); #endif #if USE_UNLINKD @@ -1136,7 +1133,7 @@ self_destruct(); } -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void parseBytesLineSigned(ssize_t * bptr, const char *units) { @@ -3055,7 +3052,7 @@ *var = 0; } -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void dump_time_msec(StoreEntry * entry, const char *name, time_msec_t var) { @@ -3092,7 +3089,7 @@ storeAppendPrintf(entry, "%s %d %s\n", name, (int) var, B_BYTES_STR); } -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void dump_b_ssize_t(StoreEntry * entry, const char *name, ssize_t var) { @@ -3136,7 +3133,7 @@ parseBytesLine(var, B_BYTES_STR); } -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void parse_b_ssize_t(ssize_t * var) { @@ -3170,7 +3167,7 @@ *var = 0; } -#if !USE_DNSSERVERS +#if !USE_DNSHELPER static void free_ssize_t(ssize_t * var) { === modified file 'src/cf.data.pre' --- src/cf.data.pre 2011-12-19 03:51:22 +0000 +++ src/cf.data.pre 2011-12-31 05:20:37 +0000 @@ -7064,7 +7064,7 @@ NAME: cache_dns_program TYPE: string -IFDEF: USE_DNSSERVERS +IFDEF: USE_DNSHELPER DEFAULT: @DEFAULT_DNSSERVER@ LOC: Config.Program.dnsserver DOC_START @@ -7073,7 +7073,7 @@ NAME: dns_children TYPE: HelperChildConfig -IFDEF: USE_DNSSERVERS +IFDEF: USE_DNSHELPER DEFAULT: 32 startup=1 idle=1 LOC: Config.dnsChildren DOC_START @@ -7107,7 +7107,7 @@ TYPE: time_msec DEFAULT: 5 seconds LOC: Config.Timeout.idns_retransmit -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START Initial retransmit interval for DNS queries. The interval is doubled each time all configured DNS servers have been tried. @@ -7117,7 +7117,7 @@ TYPE: time_msec DEFAULT: 30 seconds LOC: Config.Timeout.idns_query -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START DNS Query timeout. If no response is received to a DNS query within this time all DNS servers for the queried domain @@ -7128,7 +7128,7 @@ TYPE: b_ssize_t DEFAULT: none LOC: Config.dns.packet_max -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START Maximum number of bytes packet size to advertise via EDNS. Set to "none" to disable EDNS large packet support. @@ -7229,7 +7229,7 @@ TYPE: onoff LOC: Config.onoff.ignore_unknown_nameservers DEFAULT: on -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START By default Squid checks that DNS responses are received from the same IP addresses they are sent to. If they @@ -7242,7 +7242,7 @@ TYPE: onoff DEFAULT: on LOC: Config.onoff.dns_require_A -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START Standard practice with DNS is to lookup either A or AAAA records and use the results if it succeeds. Only looking up the other if @@ -7263,7 +7263,7 @@ TYPE: onoff DEFAULT: off LOC: Config.dns.v4_first -IFDEF: !USE_DNSSERVERS +IFDEF: !USE_DNSHELPER DOC_START With the IPv6 Internet being as fast or faster than IPv4 Internet for most networks Squid prefers to contact websites over IPv6. === modified file 'src/cf_gen_defines' --- src/cf_gen_defines 2011-08-19 03:35:19 +0000 +++ src/cf_gen_defines 2011-12-31 05:36:33 +0000 @@ -15,8 +15,8 @@ define["SQUID_SNMP"]="--enable-snmp" define["USE_ADAPTATION"]="--enable-ecap or --enable-icap-client" define["USE_CACHE_DIGESTS"]="--enable-cache-digests" - define["USE_DNSSERVERS"]="--disable-internal-dns" - define["!USE_DNSSERVERS"]="--enable-internal-dns" + define["USE_DNSHELPER"]="--disable-internal-dns" + define["!USE_DNSHELPER"]="--enable-internal-dns" define["USE_ECAP"]="--enable-ecap" define["USE_ERR_LOCALES"]="--enable-auto-locale" define["USE_HTCP"]="--enable-htcp" === modified file 'src/client_side_reply.cc' --- src/client_side_reply.cc 2011-12-30 01:24:57 +0000 +++ src/client_side_reply.cc 2011-12-31 05:37:28 +0000 @@ -1565,15 +1565,11 @@ */ if (r->flags.nocache) { -#if USE_DNSSERVERS - +#if USE_DNSHELPER ipcacheInvalidate(r->GetHost()); - #else - ipcacheInvalidateNegative(r->GetHost()); - -#endif /* USE_DNSSERVERS */ +#endif /* USE_DNSHELPER */ } @@ -1581,15 +1577,11 @@ else if (r->flags.nocache_hack) { -#if USE_DNSSERVERS - +#if USE_DNSHELPER ipcacheInvalidate(r->GetHost()); - #else - ipcacheInvalidateNegative(r->GetHost()); - -#endif /* USE_DNSSERVERS */ +#endif /* USE_DNSHELPER */ } === modified file 'src/dns.cc' --- src/dns.cc 2011-10-10 03:28:26 +0000 +++ src/dns.cc 2011-12-31 05:22:49 +0000 @@ -44,7 +44,7 @@ #if to include the external DNS code in compile process when using external DNS. */ -#if USE_DNSSERVERS +#if USE_DNSHELPER static helper *dnsservers = NULL; @@ -180,4 +180,4 @@ } #endif /* SQUID_SNMP */ -#endif /* USE_DNSSERVERS */ +#endif /* USE_DNSHELPER */ === modified file 'src/dns_internal.cc' --- src/dns_internal.cc 2011-11-22 12:00:59 +0000 +++ src/dns_internal.cc 2011-12-31 05:26:13 +0000 @@ -60,7 +60,7 @@ #ifndef to exclude the internal DNS code from compile process when using external DNS process. */ -#if !USE_DNSSERVERS +#if !USE_DNSHELPER #if _SQUID_WINDOWS_ #include "squid_windows.h" #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces" @@ -821,7 +821,7 @@ delete vc->queue; delete vc->msg; vc->conn = NULL; - if (vc->ns < nns) // XXX: idnsShutdown may have freed nameservers[] + if (vc->ns < nns) // XXX: dnsShutdown may have freed nameservers[] nameservers[vc->ns].vc = NULL; cbdataFree(vc); } @@ -1492,7 +1492,7 @@ } void -idnsInit(void) +dnsInit(void) { static int init = 0; @@ -1589,7 +1589,7 @@ } void -idnsShutdown(void) +dnsShutdown(void) { if (DnsSocketA < 0 && DnsSocketB < 0) return; @@ -1763,7 +1763,7 @@ * The function to return the DNS via SNMP */ variable_list * -snmp_netIdnsFn(variable_list * Var, snint * ErrP) +snmp_netDnsFn(variable_list * Var, snint * ErrP) { int i, n = 0; variable_list *Answer = NULL; @@ -1811,4 +1811,4 @@ } #endif /*SQUID_SNMP */ -#endif /* USE_DNSSERVERS */ +#endif /* USE_DNSHELPER */ === modified file 'src/enums.h' --- src/enums.h 2011-09-14 18:21:46 +0000 +++ src/enums.h 2011-12-31 05:42:43 +0000 @@ -228,7 +228,7 @@ // following pools are initialized late by their component if needed (or never) MEM_FQDNCACHE_ENTRY, MEM_FWD_SERVER, -#if !USE_DNSSERVERS +#if !USE_DNSHELPER MEM_IDNS_QUERY, #endif MEM_IPCACHE_ENTRY, === modified file 'src/fqdncache.cc' --- src/fqdncache.cc 2011-12-15 16:32:38 +0000 +++ src/fqdncache.cc 2012-01-01 11:34:22 +0000 @@ -37,6 +37,7 @@ #include "DnsLookupDetails.h" #include "event.h" #include "mgr/Registration.h" +#include "SquidDns.h" #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" @@ -128,7 +129,7 @@ /// \ingroup FQDNCacheInternal static dlink_list lru_list; -#if USE_DNSSERVERS +#if USE_DNSHELPER static HLPCB fqdncacheHandleReply; static int fqdncacheParse(fqdncache_entry *, const char *buf); #else @@ -340,7 +341,7 @@ } /// \ingroup FQDNCacheInternal -#if USE_DNSSERVERS +#if USE_DNSHELPER static int fqdncacheParse(fqdncache_entry *f, const char *inbuf) { @@ -492,7 +493,7 @@ * Callback for handling DNS results. */ static void -#if USE_DNSSERVERS +#if USE_DNSHELPER fqdncacheHandleReply(void *data, char *reply) #else fqdncacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_message) @@ -503,7 +504,7 @@ ++FqdncacheStats.replies; const int age = f->age(); statCounter.dns.svcTime.count(age); -#if USE_DNSSERVERS +#if USE_DNSHELPER fqdncacheParse(f, reply); #else @@ -578,8 +579,7 @@ f->handlerData = cbdataReference(handlerData); f->request_time = current_time; c = new generic_cbdata(f); -#if USE_DNSSERVERS - +#if USE_DNSHELPER dnsSubmit(hashKeyStr(&f->hash), fqdncacheHandleReply, c); #else idnsPTRLookup(addr, fqdncacheHandleReply, c); === modified file 'src/ipcache.cc' --- src/ipcache.cc 2011-12-15 16:32:38 +0000 +++ src/ipcache.cc 2012-01-01 12:45:49 +0000 @@ -39,6 +39,7 @@ #include "ip/tools.h" #include "ipcache.h" #include "mgr/Registration.h" +#include "SquidDns.h" #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" @@ -134,13 +135,13 @@ static void stat_ipcache_get(StoreEntry *); static FREE ipcacheFreeEntry; -#if USE_DNSSERVERS +#if USE_DNSHELPER static HLPCB ipcacheHandleReply; #else static IDNSCB ipcacheHandleReply; #endif static int ipcacheExpiredEntry(ipcache_entry *); -#if USE_DNSSERVERS +#if USE_DNSHELPER static int ipcacheParse(ipcache_entry *, const char *buf); #else static int ipcacheParse(ipcache_entry *, rfc1035_rr *, int, const char *error); @@ -352,7 +353,7 @@ } /// \ingroup IPCacheAPI -#if USE_DNSSERVERS +#if USE_DNSHELPER static int ipcacheParse(ipcache_entry *i, const char *inbuf) { @@ -588,7 +589,7 @@ /// \ingroup IPCacheInternal static void -#if USE_DNSSERVERS +#if USE_DNSHELPER ipcacheHandleReply(void *data, char *reply) #else ipcacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_message) @@ -600,7 +601,7 @@ const int age = i->age(); statCounter.dns.svcTime.count(age); -#if USE_DNSSERVERS +#if USE_DNSHELPER ipcacheParse(i, reply); #else @@ -693,11 +694,9 @@ i->handlerData = cbdataReference(handlerData); i->request_time = current_time; c = new generic_cbdata(i); -#if USE_DNSSERVERS - +#if USE_DNSHELPER dnsSubmit(hashKeyStr(&i->hash), ipcacheHandleReply, c); #else - idnsALookup(hashKeyStr(&i->hash), ipcacheHandleReply, c); #endif } === modified file 'src/main.cc' --- src/main.cc 2011-12-10 16:29:31 +0000 +++ src/main.cc 2012-01-01 12:48:38 +0000 @@ -66,6 +66,7 @@ #include "format/Token.h" #include "fs/Module.h" #include "PeerSelectState.h" +#include "SquidDns.h" #include "Store.h" #include "ICP.h" #include "ident/Ident.h" @@ -735,13 +736,7 @@ htcpSocketClose(); #endif -#if USE_DNSSERVERS - dnsShutdown(); -#else - - idnsShutdown(); -#endif #if USE_SSL_CRTD Ssl::Helper::GetInstance()->Shutdown(); #endif @@ -824,13 +819,7 @@ icapLogOpen(); #endif storeLogOpen(); -#if USE_DNSSERVERS - dnsInit(); -#else - - idnsInit(); -#endif #if USE_SSL_CRTD Ssl::Helper::GetInstance()->Init(); #endif @@ -888,7 +877,7 @@ mainRotate(void) { icmpEngine.Close(); -#if USE_DNSSERVERS +#if USE_DNSHELPER dnsShutdown(); #endif redirectShutdown(); @@ -905,7 +894,7 @@ icapLogRotate(); /*icap.log*/ #endif icmpEngine.Open(); -#if USE_DNSSERVERS +#if USE_DNSHELPER dnsInit(); #endif redirectInit(); @@ -1029,16 +1018,8 @@ parseEtcHosts(); -#if USE_DNSSERVERS - dnsInit(); -#else - - idnsInit(); - -#endif - #if USE_SSL_CRTD Ssl::Helper::GetInstance()->Init(); #endif @@ -1847,13 +1828,7 @@ #endif debugs(1, 1, "Shutting down..."); -#if USE_DNSSERVERS - dnsShutdown(); -#else - - idnsShutdown(); -#endif #if USE_SSL_CRTD Ssl::Helper::GetInstance()->Shutdown(); #endif === modified file 'src/protos.h' --- src/protos.h 2011-12-17 01:26:31 +0000 +++ src/protos.h 2011-12-31 05:38:58 +0000 @@ -125,17 +125,6 @@ SQUIDCEXTERN void file_read(int, char *, int, off_t, DRCB *, void *); SQUIDCEXTERN void disk_init(void); -SQUIDCEXTERN void dnsShutdown(void); -SQUIDCEXTERN void dnsInit(void); -SQUIDCEXTERN void dnsSubmit(const char *lookup, HLPCB * callback, void *data); - -/* dns_internal.c */ -SQUIDCEXTERN void idnsInit(void); -SQUIDCEXTERN void idnsShutdown(void); -SQUIDCEXTERN void idnsALookup(const char *, IDNSCB *, void *); - -SQUIDCEXTERN void idnsPTRLookup(const Ip::Address &, IDNSCB *, void *); - SQUIDCEXTERN void fd_close(int fd); SQUIDCEXTERN void fd_open(int fd, unsigned int type, const char *); SQUIDCEXTERN void fd_note(int fd, const char *); @@ -266,11 +255,7 @@ extern variable_list *snmp_prfPeerFn(variable_list *, snint *); extern variable_list *snmp_netIpFn(variable_list *, snint *); extern variable_list *snmp_netFqdnFn(variable_list *, snint *); -#if USE_DNSSERVERS extern variable_list *snmp_netDnsFn(variable_list *, snint *); -#else -extern variable_list *snmp_netIdnsFn(variable_list *, snint *); -#endif /* USE_DNSSERVERS */ extern variable_list *snmp_meshPtblFn(variable_list *, snint *); extern variable_list *snmp_meshCtblFn(variable_list *, snint *); #endif /* SQUID_SNMP */ === modified file 'src/snmp_core.cc' --- src/snmp_core.cc 2011-11-28 01:44:09 +0000 +++ src/snmp_core.cc 2011-12-31 05:22:08 +0000 @@ -236,15 +236,15 @@ snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.2", FQDN_GHBN, snmp_netFqdnFn, static_Inst, atSum); snmpAddNodeStr("1.3.6.1.4.1.3495.1.4", NET_DNS_CACHE, NULL, NULL); -#if USE_DNSSERVERS +//#if USE_DNSHELPER snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REQ, snmp_netDnsFn, static_Inst, atSum); snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REP, snmp_netDnsFn, static_Inst, atSum); snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_SERVERS, snmp_netDnsFn, static_Inst, atSum); -#else - snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REQ, snmp_netIdnsFn, static_Inst, atSum); - snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REP, snmp_netIdnsFn, static_Inst, atSum); - snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_SERVERS, snmp_netIdnsFn, static_Inst, atSum); -#endif +//#else +// snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REQ, snmp_netIdnsFn, static_Inst, atSum); +// snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_REP, snmp_netIdnsFn, static_Inst, atSum); +// snmpAddNodeStr("1.3.6.1.4.1.3495.1.4.3", DNS_SERVERS, snmp_netIdnsFn, static_Inst, atSum); +//#endif /* SQ_MESH - 1.3.6.1.4.1.3495.1.5 */ snmpAddNodeStr("1.3.6.1.4.1.3495.1", 5, NULL, NULL); === modified file 'src/structs.h' --- src/structs.h 2011-12-19 03:51:22 +0000 +++ src/structs.h 2011-12-31 05:38:10 +0000 @@ -218,8 +218,7 @@ int icp_query_min; /* msec */ int mcast_icp_query; /* msec */ -#if !USE_DNSSERVERS - +#if !USE_DNSHELPER time_msec_t idns_retransmit; time_msec_t idns_query; #endif @@ -303,7 +302,7 @@ char *effectiveGroup; struct { -#if USE_DNSSERVERS +#if USE_DNSHELPER char *dnsserver; #endif @@ -320,8 +319,7 @@ #endif } Program; -#if USE_DNSSERVERS - +#if USE_DNSHELPER HelperChildConfig dnsChildren; #endif