confip.c revision 29bf8316a33dbacaa4f37755bea495d6b9fac152
/*
* Copyright (C) 1999 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 <string.h>
#include <isc/assertions.h>
#include <dns/confcommon.h>
/* Flag for dns_c_ipmatch_element */
{
(void) lctx;
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
{
(void) lctx;
}
{
case dns_c_ipmatch_localhost:
case dns_c_ipmatch_localnets:
case dns_c_ipmatch_pattern:
/* nothing */
break;
case dns_c_ipmatch_indirect:
}
break;
case dns_c_ipmatch_key:
break;
case dns_c_ipmatch_acl:
break;
case dns_c_ipmatch_none:
"dns_ipmath_none element type");
return (ISC_R_FAILURE);
}
return (ISC_R_SUCCESS);
}
{
if (result != ISC_R_SUCCESS) {
return (result);
}
case dns_c_ipmatch_pattern:
break;
case dns_c_ipmatch_indirect:
break;
case dns_c_ipmatch_localhost:
break;
case dns_c_ipmatch_localnets:
break;
case dns_c_ipmatch_key:
break;
case dns_c_ipmatch_acl:
break;
case dns_c_ipmatch_none:
"ipmatch 'none' element type");
return (ISC_R_FAILURE);
}
return (ISC_R_SUCCESS);
}
{
return (ISC_FALSE);
case dns_c_ipmatch_pattern:
return (ISC_FALSE);
case dns_c_ipmatch_indirect:
case dns_c_ipmatch_localhost:
break;
case dns_c_ipmatch_localnets:
break;
case dns_c_ipmatch_key:
case dns_c_ipmatch_acl:
case dns_c_ipmatch_none:
break;
}
return (ISC_TRUE);
}
{
if (res == ISC_R_SUCCESS) {
}
return (res);
}
{
if (res == ISC_R_SUCCESS) {
}
return (res);
}
const char *name)
{
if (res != ISC_R_SUCCESS) {
return (res);
}
if (res == ISC_R_SUCCESS) {
}
} else {
}
return (res);
}
{
if (res != ISC_R_SUCCESS) {
return (res);
}
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
const char *key)
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
const char *aclname)
{
if (res != ISC_R_SUCCESS) {
return (res);
}
return (ISC_R_SUCCESS);
}
{
(void) lctx;
} else {
}
return (ISC_R_SUCCESS);
}
{
(void) lctx;
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
{
return (ISC_R_SUCCESS);
}
}
return (ISC_R_SUCCESS);
}
void
{
(void) lctx;
}
{
if (res != ISC_R_SUCCESS) {
break;
}
}
return (res);
}
{
if (result != ISC_R_SUCCESS) {
return (result);
}
if (result != ISC_R_SUCCESS) {
return (result);
}
}
return (ISC_R_SUCCESS);
}
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_FALSE);
}
return (ISC_FALSE);
return (ISC_TRUE);
}
{
&ime_copy,
ime);
if (result != ISC_R_SUCCESS) {
break;
}
if (negate) {
}
}
return (result);
}
{
int bits;
} else {
}
case dns_c_ipmatch_pattern:
if (bits > 0) {
}
break;
case dns_c_ipmatch_indirect:
} else {
}
break;
case dns_c_ipmatch_key:
break;
case dns_c_ipmatch_localhost:
break;
case dns_c_ipmatch_localnets:
break;
case dns_c_ipmatch_none:
"dns_ipmatch_none element type");
return (ISC_R_FAILURE);
case dns_c_ipmatch_acl:
break;
}
return (ISC_R_SUCCESS);
}
{
/* no indent on first line. */
"/* this list intentionally left blank */\n");
} else {
}
}
return (ISC_R_SUCCESS);
}
{
(void) lctx;
return (ISC_R_NOMEMORY);
}
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}
{
dns_c_iplist_t *l ;
(void) lctx;
l = *list;
l->refcount--;
if (l->refcount == 0) {
isc_mem_put(l->mem, l, sizeof *l);
}
return (ISC_R_SUCCESS);
}
void
{
(void) lctx;
}
{
isc_uint32_t i;
if (res != ISC_R_SUCCESS) {
return (res);
}
}
return (ISC_R_SUCCESS);
}
isc_uint32_t i;
return (ISC_FALSE);
return (ISC_FALSE);
}
return (ISC_TRUE);
}
void
{
isc_uint32_t i;
} else {
}
}
}
{
isc_uint32_t i;
(void) lctx;
break;
}
}
return (ISC_R_FAILURE);
}
return (ISC_R_NOMEMORY);
}
}
return (ISC_R_SUCCESS);
}
{
isc_uint32_t i;
(void) lctx;
break;
}
}
return (ISC_R_FAILURE);
}
}
return (ISC_R_SUCCESS);
}
/*
* Check that the address given is a network address with the given number
* of high order bits.
*/
static isc_result_t
{
if (bits > 0) {
return (ISC_R_FAILURE);
}
unsigned char *maskp;
unsigned char *addrp;
int i;
return (ISC_R_FAILURE);
}
for (i = 0 ; i < 16 ; i++) {
return (ISC_R_FAILURE);
}
}
}
}
return (ISC_R_SUCCESS);
}
/*
* Create a 128 bits mask in network byte order in the the IPv6 address
* section of the sockaddr. The bits argument is the number of high bits
* that are to be set to 1.
*/
static isc_result_t
{
int i;
/* Break the 128 bits up into 32-bit sections */
if (bits > 32) {
bitmask[0] = 0xffffffffU;
} else if (bits > 0) {
}
if (bits > 64) {
} else if (bits > 32) {
}
if (bits > 96) {
} else if (bits > 64) {
}
(bitmask[0] & 0xffff),
}