--------------------- PatchSet 2936 Date: 2001/09/01 15:08:11 Author: serassio Branch: nt-2_3 Tag: (none) Log: Experimental global use of IPPROTO_TCP/UDP macros Members: src/access_log.c:1.1.1.3.4.1.2.4->1.1.1.3.4.1.2.5 src/client_side.c:1.1.1.3.4.6.2.5->1.1.1.3.4.6.2.6 src/comm.c:1.1.1.3.4.1.2.6->1.1.1.3.4.1.2.7 src/dns_internal.c:1.1.1.1.4.6.2.6->1.1.1.1.4.6.2.7 src/forward.c:1.1.1.3.4.1.2.3->1.1.1.3.4.1.2.4 src/ftp.c:1.1.1.3.4.3.2.2->1.1.1.3.4.3.2.3 src/htcp.c:1.1.1.2.4.1.2.3->1.1.1.2.4.1.2.4 src/icp_v2.c:1.1.1.3.4.1.2.3->1.1.1.3.4.1.2.4 src/ident.c:1.1.1.3.4.1.2.2->1.1.1.3.4.1.2.3 src/ipc.c:1.1.1.3.4.1.2.2->1.1.1.3.4.1.2.3 src/neighbors.c:1.1.1.3.4.1.2.1->1.1.1.3.4.1.2.2 src/snmp_core.c:1.1.1.3.4.1.2.4->1.1.1.3.4.1.2.5 src/squid.h:1.1.1.3.4.1.2.3->1.1.1.3.4.1.2.4 src/ssl.c:1.1.1.3.4.1.2.2->1.1.1.3.4.1.2.3 src/wccp.c:1.1.1.1.4.2.2.2->1.1.1.1.4.2.2.3 Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.1.1.3.4.1.2.4 retrieving revision 1.1.1.3.4.1.2.5 diff -u -r1.1.1.3.4.1.2.4 -r1.1.1.3.4.1.2.5 --- squid/src/access_log.c 13 Aug 2001 17:09:16 -0000 1.1.1.3.4.1.2.4 +++ squid/src/access_log.c 1 Sep 2001 15:08:11 -0000 1.1.1.3.4.1.2.5 @@ -1,7 +1,7 @@ /* - * $Id: access_log.c,v 1.1.1.3.4.1.2.4 2001/08/13 17:09:16 serassio Exp $ + * $Id: access_log.c,v 1.1.1.3.4.1.2.5 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -402,7 +402,7 @@ mcast_miss_to.sin_port = htons(Config.mcast_miss.port); mcast_miss_to.sin_addr.s_addr = Config.mcast_miss.addr.s_addr; mcast_miss_fd = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.udp_incoming, Config.mcast_miss.port, COMM_NONBLOCKING, Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.1.1.3.4.6.2.5 retrieving revision 1.1.1.3.4.6.2.6 diff -u -r1.1.1.3.4.6.2.5 -r1.1.1.3.4.6.2.6 --- squid/src/client_side.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.6.2.5 +++ squid/src/client_side.c 1 Sep 2001 15:08:11 -0000 1.1.1.3.4.6.2.6 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.1.1.3.4.6.2.5 2001/08/13 17:09:17 serassio Exp $ + * $Id: client_side.c,v 1.1.1.3.4.6.2.6 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2865,7 +2865,7 @@ } enter_suid(); fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, s->s.sin_addr, ntohs(s->s.sin_port), COMM_NONBLOCKING, Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.1.1.3.4.1.2.6 retrieving revision 1.1.1.3.4.1.2.7 diff -u -r1.1.1.3.4.1.2.6 -r1.1.1.3.4.1.2.7 --- squid/src/comm.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.1.2.6 +++ squid/src/comm.c 1 Sep 2001 15:08:11 -0000 1.1.1.3.4.1.2.7 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.1.1.3.4.1.2.6 2001/08/13 17:09:17 serassio Exp $ + * $Id: comm.c,v 1.1.1.3.4.1.2.7 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -232,7 +232,7 @@ commSetReuseAddr(new_socket); if (port > (u_short) 0) { #ifdef _SQUID_MSWIN_ - if ( sock_type != SOCK_DGRAM && proto != IPPROTO_UDP ) + if ( sock_type != SOCK_DGRAM && proto != SQUID_IPPROTO_UDP ) #endif commSetNoLinger(new_socket); if (opt_reuseaddr) @@ -966,7 +966,7 @@ commSetTcpNoDelay(int fd) { int on = 1; - if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) + if (setsockopt(fd, SQUID_IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) debug(50, 1) ("commSetTcpNoDelay: FD %d: %s\n", fd, xstrerror()); } #endif Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/dns_internal.c,v retrieving revision 1.1.1.1.4.6.2.6 retrieving revision 1.1.1.1.4.6.2.7 diff -u -r1.1.1.1.4.6.2.6 -r1.1.1.1.4.6.2.7 --- squid/src/dns_internal.c 19 Aug 2001 19:31:38 -0000 1.1.1.1.4.6.2.6 +++ squid/src/dns_internal.c 1 Sep 2001 15:08:11 -0000 1.1.1.1.4.6.2.7 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.1.1.1.4.6.2.6 2001/08/19 19:31:38 serassio Exp $ + * $Id: dns_internal.c,v 1.1.1.1.4.6.2.7 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -595,7 +595,7 @@ static int init = 0; if (DnsSocket < 0) { DnsSocket = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.udp_outgoing, 0, COMM_NONBLOCKING, Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.1.1.3.4.1.2.3 retrieving revision 1.1.1.3.4.1.2.4 diff -u -r1.1.1.3.4.1.2.3 -r1.1.1.3.4.1.2.4 --- squid/src/forward.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.1.2.3 +++ squid/src/forward.c 1 Sep 2001 15:08:11 -0000 1.1.1.3.4.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.1.1.3.4.1.2.3 2001/08/13 17:09:17 serassio Exp $ + * $Id: forward.c,v 1.1.1.3.4.1.2.4 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -247,7 +247,7 @@ return; } fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, Config.Addrs.tcp_outgoing, 0, COMM_NONBLOCKING, Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.1.1.3.4.3.2.2 retrieving revision 1.1.1.3.4.3.2.3 diff -u -r1.1.1.3.4.3.2.2 -r1.1.1.3.4.3.2.3 --- squid/src/ftp.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.3.2.2 +++ squid/src/ftp.c 1 Sep 2001 15:08:11 -0000 1.1.1.3.4.3.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.1.1.3.4.3.2.2 2001/08/13 17:09:17 serassio Exp $ + * $Id: ftp.c,v 1.1.1.3.4.3.2.3 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1688,7 +1688,7 @@ } /* Open data channel with the same local address as control channel */ fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, addr.sin_addr, 0, COMM_NONBLOCKING, @@ -1821,7 +1821,7 @@ port = ntohs(addr.sin_port); } fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, addr.sin_addr, port, COMM_NONBLOCKING | (fallback ? COMM_REUSEADDR : 0), Index: squid/src/htcp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/htcp.c,v retrieving revision 1.1.1.2.4.1.2.3 retrieving revision 1.1.1.2.4.1.2.4 diff -u -r1.1.1.2.4.1.2.3 -r1.1.1.2.4.1.2.4 --- squid/src/htcp.c 13 Aug 2001 17:09:17 -0000 1.1.1.2.4.1.2.3 +++ squid/src/htcp.c 1 Sep 2001 15:08:11 -0000 1.1.1.2.4.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.1.1.2.4.1.2.3 2001/08/13 17:09:17 serassio Exp $ + * $Id: htcp.c,v 1.1.1.2.4.1.2.4 2001/09/01 15:08:11 serassio Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -841,7 +841,7 @@ { enter_suid(); htcpInSocket = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.udp_incoming, Config.Port.htcp, COMM_NONBLOCKING, @@ -855,7 +855,7 @@ if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); htcpOutSocket = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.udp_outgoing, Config.Port.htcp, COMM_NONBLOCKING, Index: squid/src/icp_v2.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icp_v2.c,v retrieving revision 1.1.1.3.4.1.2.3 retrieving revision 1.1.1.3.4.1.2.4 diff -u -r1.1.1.3.4.1.2.3 -r1.1.1.3.4.1.2.4 --- squid/src/icp_v2.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.1.2.3 +++ squid/src/icp_v2.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.c,v 1.1.1.3.4.1.2.3 2001/08/13 17:09:17 serassio Exp $ + * $Id: icp_v2.c,v 1.1.1.3.4.1.2.4 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -413,7 +413,7 @@ return; enter_suid(); theInIcpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.udp_incoming, port, COMM_NONBLOCKING, @@ -434,7 +434,7 @@ if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); theOutIcpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, addr, port, COMM_NONBLOCKING, Index: squid/src/ident.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ident.c,v retrieving revision 1.1.1.3.4.1.2.2 retrieving revision 1.1.1.3.4.1.2.3 diff -u -r1.1.1.3.4.1.2.2 -r1.1.1.3.4.1.2.3 --- squid/src/ident.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.1.2.2 +++ squid/src/ident.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ident.c,v 1.1.1.3.4.1.2.2 2001/08/13 17:09:17 serassio Exp $ + * $Id: ident.c,v 1.1.1.3.4.1.2.3 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -208,7 +208,7 @@ return; } fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, me->sin_addr, 0, COMM_NONBLOCKING, Index: squid/src/ipc.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipc.c,v retrieving revision 1.1.1.3.4.1.2.2 retrieving revision 1.1.1.3.4.1.2.3 diff -u -r1.1.1.3.4.1.2.2 -r1.1.1.3.4.1.2.3 --- squid/src/ipc.c 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.1.2.2 +++ squid/src/ipc.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ipc.c,v 1.1.1.3.4.1.2.2 2001/08/13 17:09:17 serassio Exp $ + * $Id: ipc.c,v 1.1.1.3.4.1.2.3 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -85,26 +85,26 @@ *wfd = -1; if (type == IPC_TCP_SOCKET) { crfd = cwfd = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_STREAM, - IPPROTO_TCP, /* protocol */ + SQUID_IPPROTO_TCP, /* protocol */ local_addr, 0, /* port */ 0, /* blocking */ name); } else if (type == IPC_UDP_SOCKET) { crfd = cwfd = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, local_addr, 0, 0, Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.1.1.3.4.1.2.1 retrieving revision 1.1.1.3.4.1.2.2 diff -u -r1.1.1.3.4.1.2.1 -r1.1.1.3.4.1.2.2 --- squid/src/neighbors.c 6 Jan 2001 12:40:14 -0000 1.1.1.3.4.1.2.1 +++ squid/src/neighbors.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.2 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.1.1.3.4.1.2.1 2001/01/06 12:40:14 hno Exp $ + * $Id: neighbors.c,v 1.1.1.3.4.1.2.2 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -988,13 +988,8 @@ { peer *p = data; int fd; -#ifdef _SQUID_MSWIN_ - fd = comm_open(SOCK_STREAM, IPPROTO_TCP, Config.Addrs.tcp_outgoing, + fd = comm_open(SOCK_STREAM, SQUID_IPPROTO_TCP, Config.Addrs.tcp_outgoing, 0, COMM_NONBLOCKING, p->host); -#else - fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing, - 0, COMM_NONBLOCKING, p->host); -#endif if (fd < 0) return; p->test_fd = fd; Index: squid/src/snmp_core.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/snmp_core.c,v retrieving revision 1.1.1.3.4.1.2.4 retrieving revision 1.1.1.3.4.1.2.5 diff -u -r1.1.1.3.4.1.2.4 -r1.1.1.3.4.1.2.5 --- squid/src/snmp_core.c 13 Aug 2001 17:09:18 -0000 1.1.1.3.4.1.2.4 +++ squid/src/snmp_core.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.1.1.3.4.1.2.4 2001/08/13 17:09:18 serassio Exp $ + * $Id: snmp_core.c,v 1.1.1.3.4.1.2.5 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -348,7 +348,7 @@ if ((port = Config.Port.snmp) > (u_short) 0) { enter_suid(); theInSnmpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.snmp_incoming, port, COMM_NONBLOCKING, @@ -362,7 +362,7 @@ if (Config.Addrs.snmp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); theOutSnmpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Addrs.snmp_outgoing, port, COMM_NONBLOCKING, Index: squid/src/squid.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/squid.h,v retrieving revision 1.1.1.3.4.1.2.3 retrieving revision 1.1.1.3.4.1.2.4 diff -u -r1.1.1.3.4.1.2.3 -r1.1.1.3.4.1.2.4 --- squid/src/squid.h 14 Jun 2001 20:36:16 -0000 1.1.1.3.4.1.2.3 +++ squid/src/squid.h 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.1.1.3.4.1.2.3 2001/06/14 20:36:16 serassio Exp $ + * $Id: squid.h,v 1.1.1.3.4.1.2.4 2001/09/01 15:08:12 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -435,4 +435,16 @@ #define SWAP_DIR_SHIFT 24 #define SWAP_FILE_MASK 0x00FFFFFF +#ifdef IPPROTO_UDP +#define SQUID_IPPROTO_UDP IPPROTO_UDP +#else +#define SQUID_IPPROTO_UDP 0 +#endif + +#ifdef IPPROTO_TCP +#define SQUID_IPPROTO_TCP IPPROTO_TCP +#else +#define SQUID_IPPROTO_TCP 0 +#endif + #endif /* SQUID_H */ Index: squid/src/ssl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ssl.c,v retrieving revision 1.1.1.3.4.1.2.2 retrieving revision 1.1.1.3.4.1.2.3 diff -u -r1.1.1.3.4.1.2.2 -r1.1.1.3.4.1.2.3 --- squid/src/ssl.c 13 Aug 2001 17:09:18 -0000 1.1.1.3.4.1.2.2 +++ squid/src/ssl.c 1 Sep 2001 15:08:12 -0000 1.1.1.3.4.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.1.1.3.4.1.2.2 2001/08/13 17:09:18 serassio Exp $ + * $Id: ssl.c,v 1.1.1.3.4.1.2.3 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -443,7 +443,7 @@ Counter.server.other.requests++; /* Create socket. */ sock = comm_open(SOCK_STREAM, - IPPROTO_TCP, + SQUID_IPPROTO_TCP, Config.Addrs.tcp_outgoing, 0, COMM_NONBLOCKING, Index: squid/src/wccp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/wccp.c,v retrieving revision 1.1.1.1.4.2.2.2 retrieving revision 1.1.1.1.4.2.2.3 diff -u -r1.1.1.1.4.2.2.2 -r1.1.1.1.4.2.2.3 --- squid/src/wccp.c 13 Aug 2001 17:09:18 -0000 1.1.1.1.4.2.2.2 +++ squid/src/wccp.c 1 Sep 2001 15:08:12 -0000 1.1.1.1.4.2.2.3 @@ -1,6 +1,6 @@ /* - * $Id: wccp.c,v 1.1.1.1.4.2.2.2 2001/08/13 17:09:18 serassio Exp $ + * $Id: wccp.c,v 1.1.1.1.4.2.2.3 2001/09/01 15:08:12 serassio Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -126,7 +126,7 @@ return; } theInWccpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Wccp.incoming, port, COMM_NONBLOCKING, @@ -142,7 +142,7 @@ (int) port, theInWccpConnection); if (Config.Wccp.outgoing.s_addr != no_addr.s_addr) { theOutWccpConnection = comm_open(SOCK_DGRAM, - IPPROTO_UDP, + SQUID_IPPROTO_UDP, Config.Wccp.outgoing, port, COMM_NONBLOCKING,