order.c File Reference

#include <config.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/types.h>
#include <isc/util.h>
#include <isc/refcount.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/order.h>
#include <dns/rdataset.h>
#include <dns/types.h>

Go to the source code of this file.

Data Structures

struct  dns_order_ent
struct  dns_order

Defines

#define DNS_ORDER_MAGIC   ISC_MAGIC('O','r','d','r')
#define DNS_ORDER_VALID(order)   ISC_MAGIC_VALID(order, DNS_ORDER_MAGIC)

Typedefs

typedef struct dns_order_ent dns_order_ent_t

Functions

isc_result_t dns_order_create (isc_mem_t *mctx, dns_order_t **orderp)
 Create a order object.
isc_result_t dns_order_add (dns_order_t *order, dns_name_t *name, dns_rdatatype_t rdtype, dns_rdataclass_t rdclass, unsigned int mode)
 Add a entry to the end of the order list.
static isc_boolean_t match (dns_name_t *name1, dns_name_t *name2)
unsigned int dns_order_find (dns_order_t *order, dns_name_t *name, dns_rdatatype_t rdtype, dns_rdataclass_t rdclass)
 Find the first matching entry on the list.
void dns_order_attach (dns_order_t *source, dns_order_t **target)
 Attach to the 'source' object.
void dns_order_detach (dns_order_t **orderp)
 Detach from the object. Clean up if last this was the last reference.


Detailed Description

Definition in file order.c.


Define Documentation

#define DNS_ORDER_MAGIC   ISC_MAGIC('O','r','d','r')

Definition at line 52 of file order.c.

Referenced by dns_order_create().

#define DNS_ORDER_VALID ( order   )     ISC_MAGIC_VALID(order, DNS_ORDER_MAGIC)

Definition at line 53 of file order.c.

Referenced by dns_order_add(), dns_order_attach(), dns_order_detach(), and dns_order_find().


Typedef Documentation

typedef struct dns_order_ent dns_order_ent_t

Definition at line 36 of file order.c.


Function Documentation

isc_result_t dns_order_create ( isc_mem_t mctx,
dns_order_t **  orderp 
)

Create a order object.

Requires:

Returns:

Definition at line 56 of file order.c.

References DNS_ORDER_MAGIC, ISC_LIST_INIT, isc_mem_attach(), isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_refcount_init(), dns_order::magic, dns_order::references, and REQUIRE.

Referenced by configure_view(), and dns_view_create().

isc_result_t dns_order_add ( dns_order_t order,
dns_name_t name,
dns_rdatatype_t  rdtype,
dns_rdataclass_t  rdclass,
unsigned int  mode 
)

Add a entry to the end of the order list.

Requires:

Returns:

Definition at line 83 of file order.c.

References dns_fixedname_init, dns_fixedname_name, dns_name_copy(), DNS_ORDER_VALID, DNS_RDATASETATTR_FIXEDORDER, DNS_RDATASETATTR_RANDOMIZE, ISC_LINK_INIT, ISC_LIST_INITANDAPPEND, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, dns_order_ent::mode, dns_order_ent::name, dns_order_ent::rdclass, dns_order_ent::rdtype, REQUIRE, and RUNTIME_CHECK.

Referenced by configure_order().

static isc_boolean_t match ( dns_name_t name1,
dns_name_t name2 
) [inline, static]

Definition at line 110 of file order.c.

References dns_name_equal(), dns_name_iswildcard(), and dns_name_matcheswildcard().

Referenced by address_ok(), allowed(), checkns(), client_newconn(), client_ok(), client_request(), client_sendpkg(), dns_dispatch_gettcp(), dns_dispatch_gettcp2(), dns_dns64_aaaafroma(), dns_dns64_aaaaok(), dns_order_find(), dns_zone_notifyreceive(), do_scan(), is_answeraddress_allowed(), isblackholed(), ns_client_checkaclsilent(), ns_client_isself(), ns_sortlist_addrorder2(), possibly_mark(), recv_done(), and udp_recv().

unsigned int dns_order_find ( dns_order_t order,
dns_name_t name,
dns_rdatatype_t  rdtype,
dns_rdataclass_t  rdclass 
)

Find the first matching entry on the list.

Requires:

Returns the mode set by dns_order_add() or zero.

Definition at line 118 of file order.c.

References dns_fixedname_name, DNS_ORDER_VALID, ISC_LIST_HEAD, ISC_LIST_NEXT, match(), dns_order_ent::mode, dns_order_ent::name, dns_order_ent::rdclass, dns_order_ent::rdtype, and REQUIRE.

Referenced by query_addrdataset().

void dns_order_attach ( dns_order_t source,
dns_order_t **  target 
)

Attach to the 'source' object.

Requires:

Definition at line 139 of file order.c.

References DNS_ORDER_VALID, isc_refcount_increment, dns_order::references, and REQUIRE.

Referenced by configure_view().

void dns_order_detach ( dns_order_t **  orderp  ) 

Detach from the object. Clean up if last this was the last reference.

Requires:

Definition at line 147 of file order.c.

References DNS_ORDER_VALID, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_put, isc_mem_putanddetach, isc_refcount_decrement, isc_refcount_destroy, dns_order::magic, dns_order::references, and REQUIRE.

Referenced by configure_view(), destroy(), and dns_view_create().


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