iptable.c File Reference

#include <config.h>
#include <isc/mem.h>
#include <isc/radix.h>
#include <dns/acl.h>

Go to the source code of this file.

Functions

static void destroy_iptable (dns_iptable_t *dtab)
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)

Variables

isc_boolean_t dns_iptable_neg = ISC_FALSE
isc_boolean_t dns_iptable_pos = ISC_TRUE


Function Documentation

static void destroy_iptable ( dns_iptable_t dtab  )  [static]

Definition at line 170 of file iptable.c.

References DNS_IPTABLE_VALID, isc_mem_putanddetach, isc_radix_destroy(), isc_refcount_destroy, dns_iptable::magic, dns_iptable::mctx, dns_iptable::radix, dns_iptable::refcount, and REQUIRE.

Referenced by dns_iptable_detach().

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().


Variable Documentation

isc_boolean_t dns_iptable_neg = ISC_FALSE

Definition at line 55 of file iptable.c.

Referenced by dns_iptable_addprefix2(), and dns_iptable_merge().

isc_boolean_t dns_iptable_pos = ISC_TRUE

Definition at line 56 of file iptable.c.

Referenced by dns_iptable_addprefix2().


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