sockaddr_test.c revision 6588a2b404365cea59e71a3f639349272600f68d
/*
* Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
*
* 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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$ */
/*! \file */
#include <config.h>
#include <atf-c.h>
#include <unistd.h>
#include <isc/sockaddr.h>
#include "isctest.h"
/*
* Individual unit tests
*/
}
int ret;
isc_test_end();
}
}
int ret;
size_t i;
struct {
const char *string;
} data4[] = {
{ "0.0.0.0", ISC_TRUE },
{ "0.0.0.1", ISC_TRUE },
{ "0.0.1.0", ISC_TRUE },
{ "0.1.0.0", ISC_TRUE },
{ "1.0.0.0", ISC_FALSE },
{ "0.0.0.127", ISC_TRUE },
{ "0.0.0.255", ISC_TRUE },
{ "127.0.0.1", ISC_FALSE },
{ "255.255.255.255", ISC_FALSE },
};
/*
* Mapped addresses are currently not netzero.
*/
struct {
const char *string;
} data6[] = {
{ "::ffff:0.0.0.0", ISC_FALSE },
{ "::ffff:0.0.0.1", ISC_FALSE },
{ "::ffff:0.0.0.127", ISC_FALSE },
{ "::ffff:0.0.0.255", ISC_FALSE },
{ "::ffff:127.0.0.1", ISC_FALSE },
{ "::ffff:255.255.255.255", ISC_FALSE },
};
r = isc_sockaddr_isnetzero(&addr);
}
r = isc_sockaddr_isnetzero(&addr);
}
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
return (atf_no_error());
}