#include <config.h>
#include <isc/mem.h>
#include <isc/util.h>
#include <dns/acl.h>
#include <dns/result.h>
#include <named/globals.h>
#include <named/server.h>
#include <named/sortlist.h>
Go to the source code of this file.
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_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. | |
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. | |
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 in file sortlist.c.
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_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().
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().
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().