sockaddr.c revision bb25076ffc6fd068c081c3c41b9782f715edd883
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <stdio.h>
#include <isc/sockaddr.h>
return (ISC_FALSE);
/*
* We don't just memcmp because the sin_zero field isn't always
* zero.
*/
return (ISC_FALSE);
case AF_INET:
return (ISC_FALSE);
return (ISC_FALSE);
break;
case AF_INET6:
return (ISC_FALSE);
return (ISC_FALSE);
break;
default:
return (ISC_FALSE);
}
return (ISC_TRUE);
}
/*
* Compare just the addresses (ignore ports)
*/
return (ISC_FALSE);
return (ISC_FALSE);
case AF_INET:
return (ISC_FALSE);
break;
case AF_INET6:
return (ISC_FALSE);
break;
default:
return (ISC_FALSE);
}
return (ISC_TRUE);
}
/*
* Compare just a prefix of the addresses (ignore ports and
* low address bits)
*/
unsigned int prefixlen)
{
isc_netaddr_fromsockaddr(&na, a);
isc_netaddr_fromsockaddr(&nb, b);
}
char pbuf[sizeof "65000"];
unsigned int plen;
if (result != ISC_R_SUCCESS)
return (result);
case AF_INET:
break;
case AF_INET6:
break;
default:
INSIST(0);
break;
}
return (ISC_R_NOSPACE);
/* Null terminate after used region. */
return (ISC_R_SUCCESS);
}
void
if (result != ISC_R_SUCCESS) {
"<unknown address, family %u>",
}
}
unsigned int
unsigned int length;
const unsigned char *s;
unsigned int h = 0;
unsigned int g;
/*
* Provide a hash value for 'sockaddr'.
*/
if (address_only) {
case AF_INET:
case AF_INET6:
break;
default:
"unknown address family: %d",
}
} else {
}
while (length > 0) {
h = ( h << 4 ) + *s;
if ((g = ( h & 0xf0000000 )) != 0) {
h = h ^ (g >> 24);
h = h ^ g;
}
s++;
length--;
}
return (h);
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
int
/*
* Get the protocol family of 'sockaddr'.
*/
/*
* Assume that PF_xxx == AF_xxx for all AF and PF.
*/
#else
case AF_INET:
return (PF_INET);
case AF_INET6:
return (PF_INET);
default:
}
#endif
}
void
{
case AF_INET:
#ifdef ISC_PLATFORM_HAVESALEN
#endif
break;
case AF_INET6:
#ifdef ISC_PLATFORM_HAVESALEN
#endif
break;
default:
INSIST(0);
}
}
void
case AF_INET:
break;
case AF_INET6:
break;
default:
}
}
case AF_INET:
break;
case AF_INET6:
break;
default:
}
return (port);
}