iptable.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007, 2012, 2014  Internet Systems Consortium, Inc. ("ISC")
00003  *
00004  * Permission to use, copy, modify, and/or distribute this software for any
00005  * purpose with or without fee is hereby granted, provided that the above
00006  * copyright notice and this permission notice appear in all copies.
00007  *
00008  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00009  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00010  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00011  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00012  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00013  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00014  * PERFORMANCE OF THIS SOFTWARE.
00015  */
00016 
00017 /* $Id: iptable.h,v 1.4 2007/09/14 01:46:05 marka Exp $ */
00018 
00019 #ifndef DNS_IPTABLE_H
00020 #define DNS_IPTABLE_H 1
00021 
00022 #include <isc/lang.h>
00023 #include <isc/magic.h>
00024 #include <isc/radix.h>
00025 
00026 #include <dns/types.h>
00027 
00028 struct dns_iptable {
00029         unsigned int            magic;
00030         isc_mem_t               *mctx;
00031         isc_refcount_t          refcount;
00032         isc_radix_tree_t        *radix;
00033         ISC_LINK(dns_iptable_t) nextincache;
00034 };
00035 
00036 #define DNS_IPTABLE_MAGIC       ISC_MAGIC('T','a','b','l')
00037 #define DNS_IPTABLE_VALID(a)    ISC_MAGIC_VALID(a, DNS_IPTABLE_MAGIC)
00038 
00039 /***
00040  *** Functions
00041  ***/
00042 
00043 ISC_LANG_BEGINDECLS
00044 
00045 isc_result_t
00046 dns_iptable_create(isc_mem_t *mctx, dns_iptable_t **target);
00047 /*
00048  * Create a new IP table and the underlying radix structure
00049  */
00050 
00051 isc_result_t
00052 dns_iptable_addprefix(dns_iptable_t *tab, isc_netaddr_t *addr,
00053                       isc_uint16_t bitlen, isc_boolean_t pos);
00054 isc_result_t
00055 dns_iptable_addprefix2(dns_iptable_t *tab, isc_netaddr_t *addr,
00056                        isc_uint16_t bitlen, isc_boolean_t pos,
00057                        isc_boolean_t is_ecs);
00058 /*
00059  * Add an IP prefix to an existing IP table
00060  */
00061 
00062 isc_result_t
00063 dns_iptable_merge(dns_iptable_t *tab, dns_iptable_t *source, isc_boolean_t pos);
00064 /*
00065  * Merge one IP table into another one.
00066  */
00067 
00068 void
00069 dns_iptable_attach(dns_iptable_t *source, dns_iptable_t **target);
00070 
00071 void
00072 dns_iptable_detach(dns_iptable_t **tabp);
00073 
00074 ISC_LANG_ENDDECLS
00075 
00076 #endif /* DNS_IPTABLE_H */

Generated on Tue Apr 28 17:40:57 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha