--------------------- PatchSet 1313 Date: 2005/04/25 13:17:00 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: Solving some update conflicts with HEAD. Renaming inet_toa into INET_TOA Members: src/ACLARP.cc:1.9.4.1->1.9.4.2 Index: squid3/src/ACLARP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLARP.cc,v retrieving revision 1.9.4.1 retrieving revision 1.9.4.2 diff -u -r1.9.4.1 -r1.9.4.2 --- squid3/src/ACLARP.cc 19 Apr 2005 10:57:54 -0000 1.9.4.1 +++ squid3/src/ACLARP.cc 25 Apr 2005 13:17:00 -0000 1.9.4.2 @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.9.4.1 2005/04/19 10:57:54 rmartinez Exp $ + * $Id: ACLARP.cc,v 1.9.4.2 2005/04/25 13:17:00 rmartinez Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -237,7 +237,7 @@ struct arpreq arpReq; - struct sockaddr_in ipAddr; + struct SOCKADDR_IN ipAddr; unsigned char ifbuffer[sizeof(struct ifreq) * 64]; @@ -260,12 +260,12 @@ /* * Set up structures for ARP lookup with blank interface name */ - ipAddr.sin_family = AF_INET; - ipAddr.sin_port = 0; + FAMILY_FROM_SA(ipAddr) = AF_INET; + PORT_FROM_SA(ipAddr) = 0; ipAddr.sin_addr = c; memset(&arpReq, '\0', sizeof(arpReq)); - xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); + xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct SOCKADDR_IN)); /* Query ARP table */ if (ioctl(HttpSockets[0], SIOCGARP, &arpReq) != -1) { @@ -284,7 +284,7 @@ memcpy (X.eth, arpReq.arp_ha.sa_data, 6); *Top = (*Top)->splay(&X, aclArpCompare); debug(28, 3) ("aclMatchArp: '%s' %s\n", - inet_ntoa(c), splayLastResult ? "NOT found" : "found"); + INET_NTOA(c), splayLastResult ? "NOT found" : "found"); return (0 == splayLastResult); } @@ -319,19 +319,19 @@ if (NULL != strchr(ifr->ifr_name, ':')) continue; - debug(28, 4) ("Looking up ARP address for %s on %s\n", inet_ntoa(c), + debug(28, 4) ("Looking up ARP address for %s on %s\n", INET_NTOA(c), ifr->ifr_name); /* Set up structures for ARP lookup */ - ipAddr.sin_family = AF_INET; + FAMILY_FROM_SA(ipAddr) = AF_INET; - ipAddr.sin_port = 0; + PORT_FROM_SA(ipAddr) = 0; ipAddr.sin_addr = c; memset(&arpReq, '\0', sizeof(arpReq)); - xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); + xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct SOCKADDR_IN)); strncpy(arpReq.arp_dev, ifr->ifr_name, sizeof(arpReq.arp_dev) - 1); @@ -377,7 +377,7 @@ /* Return if match, otherwise continue to other interfaces */ if (0 == splayLastResult) { debug(28, 3) ("aclMatchArp: %s found on %s\n", - inet_ntoa(c), ifr->ifr_name); + INET_NTOA(c), ifr->ifr_name); return 1; } @@ -391,22 +391,22 @@ struct arpreq arpReq; - struct sockaddr_in ipAddr; + struct SOCKADDR_IN ipAddr; SplayNode **Top = dataptr; /* * Set up structures for ARP lookup with blank interface name */ - ipAddr.sin_family = AF_INET; + FAMILY_FROM_SA(ipAddr) = AF_INET; - ipAddr.sin_port = 0; + PORT_FROM_SA(ipAddr) = 0; ipAddr.sin_addr = c; memset(&arpReq, '\0', sizeof(arpReq)); - xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); + xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct SOCKADDR_IN)); /* Query ARP table */ if (ioctl(HttpSockets[0], SIOCGARP, &arpReq) != -1) { @@ -431,7 +431,7 @@ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); debug(28, 3) ("aclMatchArp: '%s' %s\n", - inet_ntoa(c), splayLastResult ? "NOT found" : "found"); + INET_NTOA(c), splayLastResult ? "NOT found" : "found"); return (0 == splayLastResult); } @@ -440,7 +440,7 @@ struct arpreq arpReq; - struct sockaddr_in ipAddr; + struct SOCKADDR_IN ipAddr; SplayNode **Top = dataptr; @@ -452,22 +452,22 @@ struct rt_msghdr *rtm; - struct sockaddr_inarp *sin; + struct SOCKADDR_INarp *sin; struct sockaddr_dl *sdl; /* * Set up structures for ARP lookup with blank interface name */ - ipAddr.sin_family = AF_INET; + FAMILY_FROM_SA(ipAddr) = AF_INET; - ipAddr.sin_port = 0; + PORT_FROM_SA(ipAddr) = 0; ipAddr.sin_addr = c; memset(&arpReq, '\0', sizeof(arpReq)); - xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); + xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct SOCKADDR_IN)); /* Query ARP table */ mib[0] = CTL_NET; @@ -504,7 +504,7 @@ rtm = (struct rt_msghdr *) next; - sin = (struct sockaddr_inarp *) (rtm + 1); + sin = (struct SOCKADDR_INarp *) (rtm + 1); /*sdl = (struct sockaddr_dl *) (sin + 1); */ #define ROUNDUP(a) \ @@ -538,7 +538,7 @@ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); debug(28, 3) ("aclMatchArp: '%s' %s\n", - inet_ntoa(c), splayLastResult ? "NOT found" : "found"); + INET_NTOA(c), splayLastResult ? "NOT found" : "found"); return (0 == splayLastResult); @@ -599,7 +599,7 @@ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); debug(28, 3) ("aclMatchArp: '%s' %s\n", - inet_ntoa(c), splayLastResult ? "NOT found" : "found"); + INET_NTOA(c), splayLastResult ? "NOT found" : "found"); return (0 == splayLastResult); @@ -611,7 +611,7 @@ /* * Address was not found on any interface */ - debug(28, 3) ("aclMatchArp: %s NOT found\n", inet_ntoa(c)); + debug(28, 3) ("aclMatchArp: %s NOT found\n", INET_NTOA(c)); return 0; } @@ -636,7 +636,7 @@ size_t needed; char *buf, *next, *lim; struct rt_msghdr *rtm; - struct sockaddr_inarp *sin; + struct SOCKADDR_INarp *sin; struct sockaddr_dl *sdl; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { debug(28, 0) ("Can't estimate ARP table size!\n"); @@ -654,7 +654,7 @@ lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *) next; - sin = (struct sockaddr_inarp *) (rtm + 1); + sin = (struct SOCKADDR_INarp *) (rtm + 1); sdl = (struct sockaddr_dl *) (sin + 1); if (sin->sin_addr.s_addr == ip) { if (sdl->sdl_alen)