2 * Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
17 /* $Id: iptable.h,v 1.4 2007-09-14 01:46:05 marka Exp $ */
20 #define DNS_IPTABLE_H 1
23 #include <isc/magic.h>
24 #include <isc/radix.h>
29 isc_refcount_t refcount;
30 isc_radix_tree_t *radix;
31 ISC_LINK(dns_iptable_t) nextincache;
34 #define DNS_IPTABLE_MAGIC ISC_MAGIC('T','a','b','l')
35 #define DNS_IPTABLE_VALID(a) ISC_MAGIC_VALID(a, DNS_IPTABLE_MAGIC)
44 dns_iptable_create(isc_mem_t *mctx, dns_iptable_t **target);
46 * Create a new IP table and the underlying radix structure
50 dns_iptable_addprefix(dns_iptable_t *tab, isc_netaddr_t *addr,
51 isc_uint16_t bitlen, isc_boolean_t pos);
53 * Add an IP prefix to an existing IP table
57 dns_iptable_merge(dns_iptable_t *tab, dns_iptable_t *source, isc_boolean_t pos);
59 * Merge one IP table into another one.
63 dns_iptable_attach(dns_iptable_t *source, dns_iptable_t **target);
66 dns_iptable_detach(dns_iptable_t **tabp);
70 #endif /* DNS_IPTABLE_H */