sockaddr.c revision c54091c8ed26b98ceabcb3f82237b847e328769a
/*
* Copyright (C) 1999-2001 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.
*/
/* $Id: sockaddr.c,v 1.50 2001/10/02 06:06:15 marka Exp $ */
#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);
}
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);
}
unsigned int prefixlen)
{
isc_netaddr_fromsockaddr(&na, a);
isc_netaddr_fromsockaddr(&nb, b);
}
char pbuf[sizeof "65000"];
unsigned int plen;
/*
* Do the port first, giving us the opportunity to check for
* unsupported address families before calling
* isc_netaddr_fromsockaddr().
*/
case AF_INET:
break;
case AF_INET6:
break;
default:
return (ISC_R_FAILURE);
}
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_NOSPACE);
/*
* Null terminate after used region.
*/
return (ISC_R_SUCCESS);
}
void
if (result != ISC_R_SUCCESS) {
/*
* The message is the same as in netaddr.c.
*/
"<unknown address, family %u>"),
}
}
unsigned int
unsigned int length = 0;
const unsigned char *s = NULL;
unsigned int h = 0;
unsigned int g;
unsigned int p = 0;
case AF_INET:
break;
case AF_INET6:
if (IN6_IS_ADDR_V4MAPPED(in6)) {
} else {
s = (const unsigned char *)&sockaddr->
}
break;
default:
"unknown address family: %d"),
p = 0;
}
while (length > 0) {
h = ( h << 4 ) + *s;
if ((g = ( h & 0xf0000000 )) != 0) {
h = h ^ (g >> 24);
h = h ^ g;
}
s++;
length--;
}
if (!address_only) {
h = h ^ (p << 4);
if ((g = ( h & 0xf0000000 )) != 0) {
h = h ^ (g >> 24);
h = h ^ g;
}
}
return (h);
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
{
#ifdef ISC_PLATFORM_HAVESALEN
#endif
}
void
switch (pf) {
case AF_INET:
break;
case AF_INET6:
break;
default:
INSIST(0);
}
}
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_INET6);
default:
"unknown address family: %d"),
}
#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:
"unknown address family: %d"),
}
}
case AF_INET:
break;
case AF_INET6:
break;
default:
"unknown address family: %d"),
}
return (port);
}
return (isc_netaddr_ismulticast(&netaddr));
}