--------------------- PatchSet 4405 Date: 2007/04/28 15:09:36 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Replace #ifdef USE_IPV6 with #if USE_IPV6 inline with general squid style. Accepted hack for URI/URL bracketting from old conversion into new: NEEDS_BRACKETS(x) Members: configure.in:1.63.2.15->1.63.2.16 lib/tests/testIPAddress.h:1.1.2.2->1.1.2.3 src/ACLARP.cc:1.9.4.6->1.9.4.7 src/ACLIP.cc:1.8.2.23->1.8.2.24 src/cache_cf.cc:1.40.2.21->1.40.2.22 src/comm.cc:1.47.2.18->1.47.2.19 src/dns_internal.cc:1.15.6.12->1.15.6.13 src/net_db.cc:1.13.4.9->1.13.4.10 src/tools.cc:1.22.2.12->1.22.2.13 src/url.cc:1.9.8.12->1.9.8.13 Index: squid3/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid3/configure.in,v retrieving revision 1.63.2.15 retrieving revision 1.63.2.16 diff -u -r1.63.2.15 -r1.63.2.16 --- squid3/configure.in 22 Apr 2007 08:03:51 -0000 1.63.2.15 +++ squid3/configure.in 28 Apr 2007 15:10:41 -0000 1.63.2.16 @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.63.2.15 2007/04/22 08:03:51 amosjeffries Exp $ +dnl $Id: configure.in,v 1.63.2.16 2007/04/28 15:10:41 amosjeffries Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.63.2.15 $)dnl +AC_REVISION($Revision: 1.63.2.16 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1817,6 +1817,7 @@ AC_DEFINE(USE_IPV6_SPLITSTACK, 1, [Enable support for Windows Split-Stack IPv6 Implementation]) ;; *) + AC_DEFINE(USE_IPV6_SPLITSTACK, 0, [Disable support for Split-Stack IPv6 Implementations]) ;; esac fi @@ -1828,7 +1829,9 @@ fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT(no) + AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) + AC_DEFINE(USE_IPV6_SPLITSTACK, 0, [Disable support for Split-Stack IPv6 Implementations]) fi Index: squid3/lib/tests/testIPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/tests/Attic/testIPAddress.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/lib/tests/testIPAddress.h 22 Apr 2007 07:46:39 -0000 1.1.2.2 +++ squid3/lib/tests/testIPAddress.h 28 Apr 2007 15:09:36 -0000 1.1.2.3 @@ -15,11 +15,11 @@ /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testDefaults ); CPPUNIT_TEST( testInAddrConstructor ); -#ifdef USE_IPV6 +#if USE_IPV6 CPPUNIT_TEST( testInAddr6Constructor ); #endif CPPUNIT_TEST( testSockAddrConstructor ); -#ifdef USE_IPV6 +#if USE_IPV6 CPPUNIT_TEST( testSockAddr6Constructor ); #endif CPPUNIT_TEST( testHostentConstructor ); @@ -40,11 +40,11 @@ void testDefaults(); void testInAddrConstructor(); -#ifdef USE_IPV6 +#if USE_IPV6 void testInAddr6Constructor(); #endif void testSockAddrConstructor(); -#ifdef USE_IPV6 +#if USE_IPV6 void testSockAddr6Constructor(); #endif void testHostentConstructor(); Index: squid3/src/ACLARP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLARP.cc,v retrieving revision 1.9.4.6 retrieving revision 1.9.4.7 diff -u -r1.9.4.6 -r1.9.4.7 --- squid3/src/ACLARP.cc 12 Apr 2007 10:08:49 -0000 1.9.4.6 +++ squid3/src/ACLARP.cc 28 Apr 2007 15:09:36 -0000 1.9.4.7 @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.9.4.6 2007/04/12 10:08:49 amosjeffries Exp $ + * $Id: ACLARP.cc,v 1.9.4.7 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -261,7 +261,7 @@ * name first. If that does not succeed, the try each interface * in turn */ -#ifdef USE_IPV6 +#if USE_IPV6 /* IPv6 does not do ARP */ if(!c.IsIPv4()) { @@ -405,7 +405,7 @@ SplayNode **Top = dataptr; -#ifdef USE_IPV6 +#if USE_IPV6 /* IPv6 does not do ARP */ if(!c.IsIPv4()) { @@ -473,7 +473,7 @@ struct sockaddr_dl *sdl; -#ifdef USE_IPV6 +#if USE_IPV6 /* IPv6 does not do ARP */ if(!c.IsIPv4()) { @@ -582,7 +582,7 @@ memset(&arpReq, '\0', sizeof(arpReq)); -#ifdef USE_IPV6 +#if USE_IPV6 /* IPv6 does not do ARP */ if(!c.IsIPv4()) { Index: squid3/src/ACLIP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLIP.cc,v retrieving revision 1.8.2.23 retrieving revision 1.8.2.24 diff -u -r1.8.2.23 -r1.8.2.24 --- squid3/src/ACLIP.cc 22 Apr 2007 07:48:21 -0000 1.8.2.23 +++ squid3/src/ACLIP.cc 28 Apr 2007 15:09:36 -0000 1.8.2.24 @@ -1,5 +1,5 @@ /* - * $Id: ACLIP.cc,v 1.8.2.23 2007/04/22 07:48:21 amosjeffries Exp $ + * $Id: ACLIP.cc,v 1.8.2.24 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -314,7 +314,7 @@ case AF_INET6: { -#ifdef USE_IPV6 +#if USE_IPV6 r->addr1 = *( (struct in6_addr*)*x ); #else // Drop the IPv6 Address Index: squid3/src/cache_cf.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cache_cf.cc,v retrieving revision 1.40.2.21 retrieving revision 1.40.2.22 diff -u -r1.40.2.21 -r1.40.2.22 --- squid3/src/cache_cf.cc 22 Apr 2007 08:06:06 -0000 1.40.2.21 +++ squid3/src/cache_cf.cc 28 Apr 2007 15:09:36 -0000 1.40.2.22 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.40.2.21 2007/04/22 08:06:06 amosjeffries Exp $ + * $Id: cache_cf.cc,v 1.40.2.22 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2539,7 +2539,7 @@ host = NULL; port = 0; -#ifdef USE_IPV6 +#if USE_IPV6 if (*token == '[') { /* [host]:port */ host = token + 1; @@ -2642,7 +2642,7 @@ s->disable_pmtu_discovery = DISABLE_PMTU_OFF; -#ifdef USE_IPV6 +#if USE_IPV6 if (*token == '[') { /* [ipv6]:port */ host = token + 1; Index: squid3/src/comm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/comm.cc,v retrieving revision 1.47.2.18 retrieving revision 1.47.2.19 diff -u -r1.47.2.18 -r1.47.2.19 --- squid3/src/comm.cc 25 Apr 2007 05:37:53 -0000 1.47.2.18 +++ squid3/src/comm.cc 28 Apr 2007 15:09:36 -0000 1.47.2.19 @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.47.2.18 2007/04/25 05:37:53 amosjeffries Exp $ + * $Id: comm.cc,v 1.47.2.19 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1239,7 +1239,7 @@ memset(buf,0,MAX_IPSTRLEN); struct sockaddr_in saddr4; -#ifdef USE_IPV6 +#if USE_IPV6 struct sockaddr_in6 saddr6; if(!address.IsIPv4()) @@ -1259,7 +1259,7 @@ F->flags.called_connect = 1; statCounter.syscalls.sock.connects++; -#ifdef USE_IPV6 +#if USE_IPV6 if(!address.IsIPv4()) x = connect(sock, (struct sockaddr *)&saddr6, sizeof(saddr6)); else @@ -1276,7 +1276,7 @@ #if defined(_SQUID_NEWSOS6_) /* Makoto MATSUSHITA */ -#ifdef USE_IPV6 +#if USE_IPV6 if(!address.IsIPv4()) connect(sock, (struct sockaddr *)&saddr6, sizeof(saddr6)); else Index: squid3/src/dns_internal.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/dns_internal.cc,v retrieving revision 1.15.6.12 retrieving revision 1.15.6.13 diff -u -r1.15.6.12 -r1.15.6.13 --- squid3/src/dns_internal.cc 26 Apr 2007 01:59:38 -0000 1.15.6.12 +++ squid3/src/dns_internal.cc 28 Apr 2007 15:09:36 -0000 1.15.6.13 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.15.6.12 2007/04/26 01:59:38 amosjeffries Exp $ + * $Id: dns_internal.cc,v 1.15.6.13 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -976,7 +976,7 @@ q->start_t = current_time; q->id = idnsQueryID(); rfc1035SetQueryID(q->buf, q->id); -#ifdef USE_IPV6 +#if USE_IPV6 if(q->query.qtype == RFC1035_TYPE_AAAA) { q->sz = rfc3596BuildAAAAQuery(q->name, q->buf, sizeof(q->buf), q->id, &q->query); } @@ -990,7 +990,7 @@ return; } } -#ifdef USE_IPV6 +#if USE_IPV6 else if(q->need_A) { /* have tried and failed to find AAAA. Now try for A. */ rfc1035MessageDestroy(message); @@ -1370,7 +1370,7 @@ q->name); } -#ifdef USE_IPV6 +#if USE_IPV6 q->sz = rfc3596BuildAQuery(q->name, q->buf, sizeof(q->buf), q->id, &q->query); q->need_A = true; #else @@ -1413,7 +1413,7 @@ q->id = idnsQueryID(); -#ifdef USE_IPV6 +#if USE_IPV6 if(addr.IsIPv6()) { struct in6_addr addr6; addr.GetInAddr(addr6); Index: squid3/src/net_db.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/net_db.cc,v retrieving revision 1.13.4.9 retrieving revision 1.13.4.10 diff -u -r1.13.4.9 -r1.13.4.10 --- squid3/src/net_db.cc 22 Apr 2007 08:06:27 -0000 1.13.4.9 +++ squid3/src/net_db.cc 28 Apr 2007 15:09:36 -0000 1.13.4.10 @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.13.4.9 2007/04/22 08:06:27 amosjeffries Exp $ + * $Id: net_db.cc,v 1.13.4.10 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -351,7 +351,7 @@ { IPAddress out = in; -#ifdef USE_IPV6 +#if USE_IPV6 /* in IPv6 the 'network' should be the routing section. */ Index: squid3/src/tools.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tools.cc,v retrieving revision 1.22.2.12 retrieving revision 1.22.2.13 diff -u -r1.22.2.12 -r1.22.2.13 --- squid3/src/tools.cc 22 Apr 2007 08:06:32 -0000 1.22.2.12 +++ squid3/src/tools.cc 28 Apr 2007 15:09:36 -0000 1.22.2.13 @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.22.2.12 2007/04/22 08:06:32 amosjeffries Exp $ + * $Id: tools.cc,v 1.22.2.13 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -600,7 +600,7 @@ * reverse DNS lookup on it. */ if(! sa.IsAnyAddr() ) { -#ifdef USE_IPV6 +#if USE_IPV6 if(! sa.IsIPv4() ) { struct in6_addr ipa; Index: squid3/src/url.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/url.cc,v retrieving revision 1.9.8.12 retrieving revision 1.9.8.13 diff -u -r1.9.8.12 -r1.9.8.13 --- squid3/src/url.cc 26 Apr 2007 01:59:38 -0000 1.9.8.12 +++ squid3/src/url.cc 28 Apr 2007 15:09:36 -0000 1.9.8.13 @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.9.8.12 2007/04/26 01:59:38 amosjeffries Exp $ + * $Id: url.cc,v 1.9.8.13 2007/04/28 15:09:36 amosjeffries Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -42,7 +42,7 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789-._" -#ifdef USE_IPV6 +#if USE_IPV6 "[:]" #endif ; @@ -50,7 +50,7 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789-." -#ifdef USE_IPV6 +#if USE_IPV6 "[:]" #endif ; @@ -463,7 +463,7 @@ switch (request->method) { case METHOD_CONNECT: -#ifdef USE_IPV6 +#if USE_IPV6 snprintf(urlbuf, MAX_URL, "%s%s%s:%d", NEEDS_BRACKETS(request->host) ? "[" : null_string, request->host, @@ -480,7 +480,7 @@ if (request->port != urlDefaultPort(request->protocol)) snprintf(portbuf, 32, ":%d", request->port); -#ifdef USE_IPV6 +#if USE_IPV6 snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s%s", ProtocolStr[request->protocol], NEEDS_BRACKETS(request->host) ? "[" : null_string, @@ -520,7 +520,7 @@ switch (request->method) { case METHOD_CONNECT: -#ifdef USE_IPV6 +#if USE_IPV6 snprintf(buf, MAX_URL, "%s%s%s:%d", NEEDS_BRACKETS(request->host) ? "[" : null_string, request->host, @@ -550,7 +550,7 @@ strcat(loginbuf, "@"); } -#ifdef USE_IPV6 +#if USE_IPV6 snprintf(buf, MAX_URL, "%s://%s%s%s%s%s%s", ProtocolStr[request->protocol], NEEDS_BRACKETS(request->host) ? "[" : null_string, @@ -810,7 +810,7 @@ while (*hostStart != '\0' && *hostStart == '/') ++hostStart; -#ifdef USE_IPV6 +#if USE_IPV6 if (*hostStart == ']') ++hostStart; #endif @@ -828,7 +828,7 @@ if ((t = strrchr(Host, ':'))) *t = '\0'; -#ifdef USE_IPV6 +#if USE_IPV6 if ((t = strchr(Host, ']'))) *t = '\0'; #endif