t_sockaddr.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* 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: t_sockaddr.c,v 1.11 2001/01/09 21:42:14 bwelling Exp $ */
#include <config.h>
#include <isc/sockaddr.h>
static int
test_isc_sockaddr_eqaddrprefix(void) {
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_PASS;
}
static void
t1(void) {
int result;
"isc_sockaddr_eqaddrprefix() returns ISC_TRUE when "
"prefixes of a and b are equal, and ISC_FALSE when "
"they are not equal");
}
static int
test_isc_netaddr_masktoprefixlen(void) {
unsigned int plen;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
if (plen != 0)
return T_FAIL;
return T_FAIL;
if (plen != 31)
return T_FAIL;
return T_FAIL;
if (plen != 32)
return T_FAIL;
return T_FAIL;
if (plen != 24)
return T_FAIL;
return T_PASS;
}
static void
t2(void) {
int result;
"isc_netaddr_masktoprefixlen() calculates "
"correct prefix lengths ");
}
testspec_t T_testlist[] = {
{ t1, "isc_sockaddr_eqaddrprefix" },
{ t2, "isc_netaddr_masktoprefixlen" },
};