iptable.h File Reference

#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/radix.h>
#include <dns/types.h>

Go to the source code of this file.

Data Structures

struct  dns_iptable

Defines

#define DNS_IPTABLE_H   1
#define DNS_IPTABLE_MAGIC   ISC_MAGIC('T','a','b','l')
#define DNS_IPTABLE_VALID(a)   ISC_MAGIC_VALID(a, DNS_IPTABLE_MAGIC)

Functions

ISC_LANG_BEGINDECLS isc_result_t dns_iptable_create (isc_mem_t *mctx, dns_iptable_t **target)
isc_result_t dns_iptable_addprefix (dns_iptable_t *tab, isc_netaddr_t *addr, isc_uint16_t bitlen, isc_boolean_t pos)
isc_result_t dns_iptable_addprefix2 (dns_iptable_t *tab, isc_netaddr_t *addr, isc_uint16_t bitlen, isc_boolean_t pos, isc_boolean_t is_ecs)
isc_result_t dns_iptable_merge (dns_iptable_t *tab, dns_iptable_t *source, isc_boolean_t pos)
void dns_iptable_attach (dns_iptable_t *source, dns_iptable_t **target)
void dns_iptable_detach (dns_iptable_t **tabp)


Define Documentation

#define DNS_IPTABLE_H   1

Definition at line 20 of file iptable.h.

#define DNS_IPTABLE_MAGIC   ISC_MAGIC('T','a','b','l')

Definition at line 36 of file iptable.h.

Referenced by dns_iptable_create().

#define DNS_IPTABLE_VALID (  )     ISC_MAGIC_VALID(a, DNS_IPTABLE_MAGIC)

Definition at line 37 of file iptable.h.

Referenced by destroy_iptable(), dns_iptable_addprefix2(), dns_iptable_attach(), and dns_iptable_detach().


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t dns_iptable_create ( isc_mem_t mctx,
dns_iptable_t **  target 
)

Definition at line 30 of file iptable.c.

References cleanup(), dns_iptable_detach(), DNS_IPTABLE_MAGIC, isc_mem_attach(), isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_radix_create(), isc_refcount_init(), dns_iptable::magic, dns_iptable::mctx, dns_iptable::radix, RADIX_MAXBITS, and dns_iptable::refcount.

Referenced by dns_acl_create().

isc_result_t dns_iptable_addprefix ( dns_iptable_t tab,
isc_netaddr_t addr,
isc_uint16_t  bitlen,
isc_boolean_t  pos 
)

Definition at line 62 of file iptable.c.

References dns_iptable_addprefix2(), and ISC_FALSE.

Referenced by add_listenelt(), cfg_acl_fromconfig2(), dns_acl_anyornone(), and setup_locals().

isc_result_t dns_iptable_addprefix2 ( dns_iptable_t tab,
isc_netaddr_t addr,
isc_uint16_t  bitlen,
isc_boolean_t  pos,
isc_boolean_t  is_ecs 
)

Definition at line 69 of file iptable.c.

References isc_prefix::bitlen, isc_radix_node::data, dns_iptable_neg, dns_iptable_pos, DNS_IPTABLE_VALID, isc_prefix::family, INSIST, ISC_R_SUCCESS, isc_radix_insert(), ISC_RADIX_OFF, isc_refcount_destroy, NETADDR_TO_PREFIX_T, dns_iptable::radix, and isc_prefix::refcount.

Referenced by cfg_acl_fromconfig2(), and dns_iptable_addprefix().

isc_result_t dns_iptable_merge ( dns_iptable_t tab,
dns_iptable_t source,
isc_boolean_t  pos 
)

Definition at line 115 of file iptable.c.

References isc_radix_node::data, dns_iptable_neg, isc_radix_tree::head, ISC_R_SUCCESS, isc_radix_insert(), new_node(), isc_radix_node::node_num, isc_radix_tree::num_added_node, dns_iptable::radix, RADIX_WALK, and RADIX_WALK_END.

Referenced by dns_acl_merge().

void dns_iptable_attach ( dns_iptable_t source,
dns_iptable_t **  target 
)

Definition at line 152 of file iptable.c.

References DNS_IPTABLE_VALID, isc_refcount_increment, dns_iptable::refcount, and REQUIRE.

void dns_iptable_detach ( dns_iptable_t **  tabp  ) 

Definition at line 159 of file iptable.c.

References destroy_iptable(), DNS_IPTABLE_VALID, isc_refcount_decrement, dns_iptable::refcount, and REQUIRE.

Referenced by destroy(), and dns_iptable_create().


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