iptable.c revision 12e0477d4e132c9122312246ed60aaa646f819b2
/*
* Copyright (C) 2007 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: iptable.c,v 1.4 2007/09/14 01:46:05 marka Exp $ */
/*
* 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
*/
{
if (result != ISC_R_SUCCESS)
return(result);
/* If the node already contains data, don't overwrite it */
if (pos)
else
}
return (ISC_R_SUCCESS);
}
/*
* Merge one IP table into another one.
*/
{
int 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.
*/
if (!pos &&
else
return (ISC_R_SUCCESS);
}
void
}
void
unsigned int refs;
if (refs == 0)
}
static void
}
}