iptable.c revision 1a63fb1d1448ed3f8fd7227ae57be67c2e71279e
/*
* Copyright (C) 2007-2009, 2013, 2014 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.
*/
#include <config.h>
/*
* Create a new IP table and the underlying radix structure
*/
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
}
/*
* Add an IP prefix to an existing IP table
*/
{
}
{
int i;
if (result != ISC_R_SUCCESS) {
return(result);
}
/* If a node already contains data, don't overwrite it */
/* "any" or "none" */
for (i = 0; i < 4; i++) {
: &dns_iptable_neg;
}
} else {
/* any other prefix */
: &dns_iptable_neg;
}
}
return (ISC_R_SUCCESS);
}
/*
* Merge one IP table into another one.
*/
{
int i, max_node = 0;
if (result != ISC_R_SUCCESS)
return(result);
/*
* If we're negating a nested ACL, then we should
* reverse the sense of every node. However, this
* could lead to a negative node in a nested ACL
* becoming a positive match in the parent, which
* could be a security risk. To prevent this, we
* just leave the negative nodes negative.
*/
for (i = 0; i < 4; i++) {
if (!pos) {
}
}
return (ISC_R_SUCCESS);
}
void
}
void
unsigned int refs;
if (refs == 0)
}
static void
}
}