/*
- * $Id: acl.cc,v 1.299 2003/02/08 15:54:36 hno Exp $
+ * $Id: acl.cc,v 1.300 2003/02/08 17:32:43 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
arpReq.arp_ha.sa_data[2] & 0xff, arpReq.arp_ha.sa_data[3] & 0xff,
arpReq.arp_ha.sa_data[4] & 0xff, arpReq.arp_ha.sa_data[5] & 0xff);
/* Do lookup */
- *Top = splay_splay(&arpReq.arp_ha.sa_data, *Top, aclArpCompare);
+ const void *X = arpReq.arp_ha.sa_data;
+ *Top = splay_splay(&X, *Top, aclArpCompare);
debug(28, 3) ("aclMatchArp: '%s' %s\n",
inet_ntoa(c), splayLastResult ? "NOT found" : "found");
return (0 == splayLastResult);
arpReq.arp_ha.sa_data[4] & 0xff,
arpReq.arp_ha.sa_data[5] & 0xff, ifr->ifr_name);
/* Do lookup */
- *Top = splay_splay(&arpReq.arp_ha.sa_data, *Top, aclArpCompare);
+ const void *X = arpReq.arp_ha.sa_data;
+ *Top = splay_splay(&X, *Top, aclArpCompare);
/* Return if match, otherwise continue to other interfaces */
if (0 == splayLastResult) {
debug(28, 3) ("aclMatchArp: %s found on %s\n",
static int
aclArpCompare(void * const &a, void * const &b)
{
-#if defined(_SQUID_LINUX_)
- const unsigned short *d1 = (const unsigned short *)a;
- const unsigned short *d2 = (const unsigned short *)b;
- if (d1[0] != d2[0])
- return (d1[0] > d2[0]) ? 1 : -1;
- if (d1[1] != d2[1])
- return (d1[1] > d2[1]) ? 1 : -1;
- if (d1[2] != d2[2])
- return (d1[2] > d2[2]) ? 1 : -1;
-#elif defined(_SQUID_SOLARIS_)
- const unsigned char *d1 = (const unsigned char *)a;
- const unsigned char *d2 = (const unsigned char *)b;
- if (d1[0] != d2[0])
- return (d1[0] > d2[0]) ? 1 : -1;
- if (d1[1] != d2[1])
- return (d1[1] > d2[1]) ? 1 : -1;
- if (d1[2] != d2[2])
- return (d1[2] > d2[2]) ? 1 : -1;
- if (d1[3] != d2[3])
- return (d1[3] > d2[3]) ? 1 : -1;
- if (d1[4] != d2[4])
- return (d1[4] > d2[4]) ? 1 : -1;
- if (d1[5] != d2[5])
- return (d1[5] > d2[5]) ? 1 : -1;
-#else
- WRITE ME;
-#endif
- return 0;
+ return memcmp(a, b, 6);
}
#if UNUSED_CODE
#endif
static void
-aclDumpArpListWalkee(void * &node, void *state)
+aclDumpArpListWalkee(void * const &node, void *state)
{
acl_arp_data *arp = (acl_arp_data *)node;
static char buf[24];