sortlist.h File Reference

#include <isc/types.h>
#include <dns/types.h>

Go to the source code of this file.

Defines

#define NAMED_SORTLIST_H   1

Typedefs

typedef int(* dns_addressorderfunc_t )(const isc_netaddr_t *address, const void *arg)
 Type for callback functions that rank addresses.

Enumerations

enum  ns_sortlisttype_t { NS_SORTLISTTYPE_NONE, NS_SORTLISTTYPE_1ELEMENT, NS_SORTLISTTYPE_2ELEMENT }
 Return value type for setup_sortlist. More...

Functions

ns_sortlisttype_t ns_sortlist_setup (dns_acl_t *acl, isc_netaddr_t *clientaddr, const void **argp)
 Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
int ns_sortlist_addrorder1 (const isc_netaddr_t *addr, const void *arg)
 Find the sort order of 'addr' in 'arg', the matching element of a 1-element top-level sortlist statement.
int ns_sortlist_addrorder2 (const isc_netaddr_t *addr, const void *arg)
 Find the sort order of 'addr' in 'arg', a topology-like ACL forming the second element in a 2-element top-level sortlist statement.
void ns_sortlist_byaddrsetup (dns_acl_t *sortlist_acl, isc_netaddr_t *client_addr, dns_addressorderfunc_t *orderp, const void **argp)
 Find the sortlist statement in 'acl' that applies to 'clientaddr', if any. If a sortlist statement applies, return in '*orderp' a pointer to a function for ranking network addresses based on that sortlist statement, and in '*argp' an argument to pass to said function. If no sortlist statement applies, set '*orderp' and '*argp' to NULL.


Detailed Description

Definition in file sortlist.h.


Define Documentation

#define NAMED_SORTLIST_H   1

Definition at line 21 of file sortlist.h.


Typedef Documentation

typedef int(* dns_addressorderfunc_t)(const isc_netaddr_t *address, const void *arg)

Type for callback functions that rank addresses.

Definition at line 33 of file sortlist.h.


Enumeration Type Documentation

enum ns_sortlisttype_t

Return value type for setup_sortlist.

Enumerator:
NS_SORTLISTTYPE_NONE 
NS_SORTLISTTYPE_1ELEMENT 
NS_SORTLISTTYPE_2ELEMENT 

Definition at line 38 of file sortlist.h.


Function Documentation

ns_sortlisttype_t ns_sortlist_setup ( dns_acl_t acl,
isc_netaddr_t clientaddr,
const void **  argp 
)

Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.

If a 1-element sortlist item applies, return NS_SORTLISTTYPE_1ELEMENT and make '*argp' point to the matching subelement.

If a 2-element sortlist item applies, return NS_SORTLISTTYPE_2ELEMENT and make '*argp' point to ACL that forms the second element.

If no sortlist item applies, return NS_SORTLISTTYPE_NONE and set '*argp' to NULL.

Definition at line 35 of file sortlist.c.

References dns_aclelement_match(), dns_aclelementtype_localhost, dns_aclelementtype_localnets, dns_aclelementtype_nestedacl, dns_acl::elements, INSIST, dns_acl::length, dns_aclelement::negative, dns_aclelement::nestedacl, NS_SORTLISTTYPE_1ELEMENT, NS_SORTLISTTYPE_2ELEMENT, NS_SORTLISTTYPE_NONE, and dns_aclelement::type.

Referenced by ns_sortlist_byaddrsetup(), and setup_query_sortlist().

int ns_sortlist_addrorder1 ( const isc_netaddr_t addr,
const void *  arg 
)

Find the sort order of 'addr' in 'arg', the matching element of a 1-element top-level sortlist statement.

Definition at line 133 of file sortlist.c.

References dns_aclelement_match().

Referenced by ns_sortlist_byaddrsetup(), and query_sortlist_order_1element().

int ns_sortlist_addrorder2 ( const isc_netaddr_t addr,
const void *  arg 
)

Find the sort order of 'addr' in 'arg', a topology-like ACL forming the second element in a 2-element top-level sortlist statement.

Definition at line 117 of file sortlist.c.

References dns_acl_match(), and match().

Referenced by ns_sortlist_byaddrsetup(), and query_sortlist_order_2element().

void ns_sortlist_byaddrsetup ( dns_acl_t sortlist_acl,
isc_netaddr_t client_addr,
dns_addressorderfunc_t orderp,
const void **  argp 
)

Find the sortlist statement in 'acl' that applies to 'clientaddr', if any. If a sortlist statement applies, return in '*orderp' a pointer to a function for ranking network addresses based on that sortlist statement, and in '*argp' an argument to pass to said function. If no sortlist statement applies, set '*orderp' and '*argp' to NULL.

Definition at line 145 of file sortlist.c.

References ns_sortlist_addrorder1(), ns_sortlist_addrorder2(), ns_sortlist_setup(), NS_SORTLISTTYPE_1ELEMENT, NS_SORTLISTTYPE_2ELEMENT, NS_SORTLISTTYPE_NONE, and UNEXPECTED_ERROR.

Referenced by sort_addresses().


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