client.h File Reference

This module defines two objects, ns_client_t and ns_clientmgr_t. More...

#include <isc/buffer.h>
#include <isc/magic.h>
#include <isc/stdtime.h>
#include <isc/quota.h>
#include <isc/queue.h>
#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/rdatatype.h>
#include <dns/tcpmsg.h>
#include <dns/types.h>
#include <named/types.h>
#include <named/query.h>

Go to the source code of this file.

Data Structures

struct  ns_client
 nameserver client structure More...

Defines

#define NAMED_CLIENT_H   1
#define NS_CLIENT_MAGIC   ISC_MAGIC('N','S','C','c')
#define NS_CLIENT_VALID(c)   ISC_MAGIC_VALID(c, NS_CLIENT_MAGIC)
#define NS_CLIENTATTR_TCP   0x0001
#define NS_CLIENTATTR_RA   0x0002
 Client gets recursive service.
#define NS_CLIENTATTR_PKTINFO   0x0004
 pktinfo is valid
#define NS_CLIENTATTR_MULTICAST   0x0008
 recv'd from multicast
#define NS_CLIENTATTR_WANTDNSSEC   0x0010
 include dnssec records
#define NS_CLIENTATTR_WANTNSID   0x0020
 include nameserver ID
#define NS_CLIENTATTR_WANTAD   0x0100
 want AD in response if possible
#define NS_CLIENTATTR_WANTSIT   0x0200
 include SIT
#define NS_CLIENTATTR_HAVESIT   0x0400
 has a valid SIT
#define NS_CLIENTATTR_WANTEXPIRE   0x0800
 return seconds to expire
#define NS_CLIENTATTR_HAVEEXPIRE   0x1000
 return seconds to expire
#define NS_CLIENTATTR_WANTOPT   0x2000
 add opt to reply
#define NS_CLIENTATTR_HAVEECS   0x4000
 sent an ECS option
#define NS_CLIENTATTR_NOSETFC   0x8000
 don't set servfail cache
#define NS_FAILCACHE_CD   0x01
#define NS_CLIENT_ACLMSGSIZE(x)

Functions

typedef ISC_QUEUE (ns_client_t) client_queue_t
typedef ISC_LIST (ns_client_t) client_list_t
void ns_client_send (ns_client_t *client)
 Note! These ns_client_ routines MUST be called ONLY from the client's task in order to ensure synchronization.
void ns_client_sendraw (ns_client_t *client, dns_message_t *msg)
 Finish processing the current client request and send client->message as a response.
void ns_client_error (ns_client_t *client, isc_result_t result)
 Finish processing the current client request and send msg as a response using client->message->id for the id.
void ns_client_next (ns_client_t *client, isc_result_t result)
 Finish processing the current client request and return an error response to the client. The error response will have an RCODE determined by 'result'.
isc_boolean_t ns_client_shuttingdown (ns_client_t *client)
 Finish processing the current client request, return no response to the client.
void ns_client_attach (ns_client_t *source, ns_client_t **target)
 Return ISC_TRUE iff the client is currently shutting down.
void ns_client_detach (ns_client_t **clientp)
 Attach '*targetp' to 'source'.
isc_result_t ns_client_replace (ns_client_t *client)
 Detach '*clientp' from its client.
void ns_client_settimeout (ns_client_t *client, unsigned int seconds)
 Try to replace the current client with a new one, so that the current one can go off and do some lengthy work without leaving the dispatch/socket without service.
isc_result_t ns_clientmgr_create (isc_mem_t *mctx, isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr, ns_clientmgr_t **managerp)
 Set a timer in the client to go off in the specified amount of time.
void ns_clientmgr_destroy (ns_clientmgr_t **managerp)
 Create a client manager.
isc_result_t ns_clientmgr_createclients (ns_clientmgr_t *manager, unsigned int n, ns_interface_t *ifp, isc_boolean_t tcp)
 Destroy a client manager and all ns_client_t objects managed by it.
isc_sockaddr_tns_client_getsockaddr (ns_client_t *client)
 Create up to 'n' clients listening on interface 'ifp'. If 'tcp' is ISC_TRUE, the clients will listen for TCP connections, otherwise for UDP requests.
isc_result_t ns_client_checkaclsilent (ns_client_t *client, isc_netaddr_t *netaddr, dns_acl_t *acl, isc_boolean_t default_allow)
 Get the socket address of the client whose request is currently being processed.
isc_result_t ns_client_checkacl (ns_client_t *client, isc_sockaddr_t *sockaddr, const char *opname, dns_acl_t *acl, isc_boolean_t default_allow, int log_level)
 Convenience function for client request ACL checking.
void ns_client_log (ns_client_t *client, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt,...) ISC_FORMAT_PRINTF(5
 Like ns_client_checkaclsilent, except the outcome of the check is logged at log level 'log_level' if denied, and at debug 3 if approved. Log messages will refer to the request as an 'opname' request.
void void ns_client_logv (ns_client_t *client, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, va_list ap) ISC_FORMAT_PRINTF(5
void void void ns_client_aclmsg (const char *msg, dns_name_t *name, dns_rdatatype_t type, dns_rdataclass_t rdclass, char *buf, size_t len)
void ns_client_recursing (ns_client_t *client)
void ns_client_killoldestquery (ns_client_t *client)
 Add client to end of th recursing list.
void ns_client_dumprecursing (FILE *f, ns_clientmgr_t *manager)
 Kill the oldest recursive query (recursing list head).
void ns_client_qnamereplace (ns_client_t *client, dns_name_t *name)
 Dump the outstanding recursive queries to 'f'.
isc_boolean_t ns_client_isself (dns_view_t *myview, dns_tsigkey_t *mykey, isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr, dns_rdataclass_t rdclass, void *arg)
 Replace the qname.
isc_result_t ns_client_sourceip (dns_clientinfo_t *ci, isc_sockaddr_t **addrp)
 Isself callback.
isc_result_t ns_client_addopt (ns_client_t *client, dns_message_t *message, dns_rdataset_t **opt)

Variables

unsigned int ns_client_requests


Detailed Description

This module defines two objects, ns_client_t and ns_clientmgr_t.

An ns_client_t object handles incoming DNS requests from clients on a given network interface.

Each ns_client_t object can handle only one TCP connection or UDP request at a time. Therefore, several ns_client_t objects are typically created to serve each network interface, e.g., one for handling TCP requests and a few (one per CPU) for handling UDP requests.

Incoming requests are classified as queries, zone transfer requests, update requests, notify requests, etc, and handed off to the appropriate request handler. When the request has been fully handled (which can be much later), the ns_client_t must be notified of this by calling one of the following functions exactly once in the context of its task:

   ns_client_send()     (sending a non-error response)
   ns_client_sendraw() (sending a raw response)
   ns_client_error()    (sending an error response)
   ns_client_next()     (sending no response)
 *
This will release any resources used by the request and and allow the ns_client_t to listen for the next request.

A ns_clientmgr_t manages a number of ns_client_t objects. New ns_client_t objects are created by calling ns_clientmgr_createclients(). They are destroyed by destroying their manager.

Definition in file client.h.


Define Documentation

#define NAMED_CLIENT_H   1

Definition at line 21 of file client.h.

#define NS_CLIENT_MAGIC   ISC_MAGIC('N','S','C','c')

Definition at line 179 of file client.h.

Referenced by client_create().

#define NS_CLIENT_VALID (  )     ISC_MAGIC_VALID(c, NS_CLIENT_MAGIC)

Definition at line 180 of file client.h.

Referenced by client_delay(), client_newconn(), client_request(), client_send(), client_senddone(), client_shutdown(), client_timeout(), exit_check(), ns_client_addopt(), ns_client_attach(), ns_client_error(), ns_client_killoldestquery(), ns_client_next(), ns_client_recursing(), ns_client_sendraw(), ns_client_sourceip(), prefetch_done(), query_addadditional(), query_addadditional2(), and query_resume().

#define NS_CLIENTATTR_TCP   0x0001

Definition at line 182 of file client.h.

Referenced by get_client(), get_worker(), log_query(), ns_client_endrequest(), ns_query_start(), ns_xfr_start(), query_find(), query_prefetch(), query_recurse(), send_forward_event(), and sendstream().

#define NS_CLIENTATTR_RA   0x0002

Client gets recursive service.

Definition at line 183 of file client.h.

Referenced by client_request(), client_send(), ns_query_start(), query_find(), and sendstream().

#define NS_CLIENTATTR_PKTINFO   0x0004

pktinfo is valid

Definition at line 184 of file client.h.

Referenced by client_request(), and client_sendpkg().

#define NS_CLIENTATTR_MULTICAST   0x0008

recv'd from multicast

Definition at line 185 of file client.h.

Referenced by client_request(), and client_sendpkg().

#define NS_CLIENTATTR_WANTDNSSEC   0x0010

include dnssec records

Definition at line 186 of file client.h.

Referenced by client_send(), ns_query_start(), query_find(), and rpz_add_cname().

#define NS_CLIENTATTR_WANTNSID   0x0020

include nameserver ID

Definition at line 187 of file client.h.

Referenced by ns_client_addopt(), process_opt(), and sendstream().

#define NS_CLIENTATTR_WANTAD   0x0100

want AD in response if possible

Definition at line 192 of file client.h.

Referenced by ns_query_start(), query_find(), and rpz_add_cname().

#define NS_CLIENTATTR_WANTSIT   0x0200

include SIT

Definition at line 193 of file client.h.

Referenced by ns_client_addopt().

#define NS_CLIENTATTR_HAVESIT   0x0400

has a valid SIT

Definition at line 194 of file client.h.

Referenced by client_allocsendbuf().

#define NS_CLIENTATTR_WANTEXPIRE   0x0800

return seconds to expire

Definition at line 195 of file client.h.

Referenced by ns_xfr_start(), process_opt(), and query_find().

#define NS_CLIENTATTR_HAVEEXPIRE   0x1000

return seconds to expire

Definition at line 196 of file client.h.

Referenced by ns_client_addopt(), ns_xfr_start(), query_find(), and sendstream().

#define NS_CLIENTATTR_WANTOPT   0x2000

add opt to reply

Definition at line 197 of file client.h.

Referenced by client_send(), process_opt(), and sendstream().

#define NS_CLIENTATTR_HAVEECS   0x4000

sent an ECS option

Definition at line 198 of file client.h.

Referenced by client_request(), ns_client_addopt(), ns_client_checkaclsilent(), and process_ecs().

#define NS_CLIENTATTR_NOSETFC   0x8000

don't set servfail cache

Definition at line 200 of file client.h.

Referenced by ns_client_error(), ns_query_start(), and query_find().

#define NS_FAILCACHE_CD   0x01

Definition at line 206 of file client.h.

Referenced by ns_client_error(), and query_find().

#define NS_CLIENT_ACLMSGSIZE (  ) 

Value:

Definition at line 376 of file client.h.

Referenced by ns_xfr_start(), query_getcachedb(), and query_validatezonedb().


Function Documentation

typedef ISC_QUEUE ( ns_client_t   ) 

typedef ISC_LIST ( ns_client_t   ) 

void ns_client_send ( ns_client_t client  ) 

Note! These ns_client_ routines MUST be called ONLY from the client's task in order to ensure synchronization.

Definition at line 1201 of file client.c.

References client_delay(), client_send(), ns_client::delaytimer, dummy, isc_interval_set(), ISC_R_SUCCESS, isc_timer_create(), isc_timertype_once, ns_client::manager, ns_client::mortal, ns_client_attach(), ns_client_detach(), ns_client_replace(), ns_client::task, and ns_clientmgr::timermgr.

Referenced by ns_client_error(), query_send(), respond(), and sendstream().

void ns_client_sendraw ( ns_client_t client,
dns_message_t msg 
)

Finish processing the current client request and send client->message as a response.

Note! These ns_client_ routines MUST be called ONLY from the client's task in order to ensure synchronization.

Definition at line 938 of file client.c.

References isc_region::base, buffer, client_allocsendbuf(), client_sendpkg(), CTRACE, dns_message_getrawmessage(), dns_message::id, isc_buffer_availableregion, isc_buffer_copyregion(), isc_mem_put, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_region::length, ns_client::mctx, ns_client::message, ns_client_next(), NS_CLIENT_VALID, r, REQUIRE, SEND_BUFFER_SIZE, TCP_BUFFER_SIZE, and ns_client::tcpbuf.

Referenced by forward_done().

void ns_client_error ( ns_client_t client,
isc_result_t  result 
)

Finish processing the current client request and send msg as a response using client->message->id for the id.

Definition at line 1269 of file client.c.

References ns_client::addr, ns_client::attributes, CTRACE, dns_badcache_add(), DNS_LOGCATEGORY_SECURITY, dns_message_reply(), DNS_MESSAGEFLAG_AA, DNS_MESSAGEFLAG_AD, DNS_MESSAGEFLAG_CD, DNS_MESSAGEFLAG_QR, dns_nsstatscounter_dropped, dns_nsstatscounter_ratedropped, DNS_R_DROP, dns_rcode_formerr, dns_rcode_noerror, dns_rcode_nxdomain, dns_rcode_servfail, dns_rcode_totext(), dns_result_torcode(), dns_rrl(), DNS_RRL_LOG_BUF_LEN, DNS_RRL_LOG_DROP, DNS_RRL_RESULT_OK, DROPPORT_NO, dns_view::fail_ttl, dns_view::failcache, dns_message::flags, ns_client::formerrcache, ns_client::id, dns_message::id, INSIST, isc_buffer_init, isc_buffer_putstr, isc_buffer_usedlength, ISC_FALSE, isc_interval_set(), ISC_LOG_DEBUG, isc_log_wouldlog(), ISC_R_SUCCESS, isc_sockaddr_equal(), isc_sockaddr_getport(), isc_stats_increment(), isc_time_nowplusinterval(), ISC_TRUE, dns_rrl::log_only, ns_client::message, ns_client::now, ns_client_dropport(), ns_client_log(), ns_client_next(), ns_client_send(), NS_CLIENT_VALID, NS_CLIENTATTR_NOSETFC, NS_FAILCACHE_CD, NS_LOGCATEGORY_CLIENT, NS_LOGCATEGORY_QUERY_EERRORS, NS_LOGMODULE_CLIENT, ns_client::peeraddr, ns_query::qname, ns_query::qtype, ns_client::query, dns_message::rcode, ns_client::requesttime, REQUIRE, dns_view::rrl, TCP_CLIENT, ns_client::time, and ns_client::view.

Referenced by client_request(), ns_xfr_start(), process_opt(), and query_error().

void ns_client_next ( ns_client_t client,
isc_result_t  result 
)

Finish processing the current client request and return an error response to the client. The error response will have an RCODE determined by 'result'.

Definition at line 731 of file client.c.

References CTRACE, DNS_LOGCATEGORY_SECURITY, exit_check(), ISC_LOG_DEBUG, ISC_R_SUCCESS, isc_result_totext(), ns_client::newstate, ns_client_log(), NS_CLIENT_VALID, NS_CLIENTSTATE_READING, NS_CLIENTSTATE_READY, NS_CLIENTSTATE_RECURSING, NS_CLIENTSTATE_WORKING, NS_LOGMODULE_CLIENT, REQUIRE, ns_client::state, and TCP_CLIENT.

Referenced by client_read(), client_request(), client_send(), client_senddone(), ns_client_error(), ns_client_sendraw(), query_next(), respond(), xfrout_maybe_destroy(), and xfrout_senddone().

isc_boolean_t ns_client_shuttingdown ( ns_client_t client  ) 

Finish processing the current client request, return no response to the client.

Definition at line 3015 of file client.c.

References ISC_TF, ns_client::newstate, and NS_CLIENTSTATE_FREED.

Referenced by query_resume().

void ns_client_attach ( ns_client_t source,
ns_client_t **  target 
)

Return ISC_TRUE iff the client is currently shutting down.

Definition at line 2990 of file client.c.

References ISC_LOG_DEBUG, ns_client_log(), NS_CLIENT_VALID, NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_CLIENT, ns_client::references, and REQUIRE.

Referenced by ns_client_send(), ns_query_start(), query_prefetch(), send_forward_event(), send_update_event(), xfrout_ctx_create(), and xfrout_ctx_destroy().

void ns_client_detach ( ns_client_t **  clientp  ) 

Attach '*targetp' to 'source'.

Definition at line 3002 of file client.c.

References exit_check(), INSIST, ISC_LOG_DEBUG, ns_client_log(), NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_CLIENT, and ns_client::references.

Referenced by client_delay(), forward_done(), forward_fail(), ns_client_send(), prefetch_done(), query_find(), query_prefetch(), query_resume(), updatedone_action(), and xfrout_ctx_destroy().

isc_result_t ns_client_replace ( ns_client_t client  ) 

Detach '*clientp' from its client.

Definition at line 3020 of file client.c.

References CTRACE, ns_client::dispatch, get_client(), get_worker(), ns_client::interface, ISC_R_SUCCESS, ISC_TRUE, ns_client::manager, ns_client::mortal, ns_client::pipelined, REQUIRE, TCP_CLIENT, and ns_client::tcpsocket.

Referenced by client_newconn(), client_request(), ns_client_send(), ns_query_start(), query_recurse(), and send_forward_event().

void ns_client_settimeout ( ns_client_t client,
unsigned int  seconds 
)

Try to replace the current client with a new one, so that the current one can go off and do some lengthy work without leaving the dispatch/socket without service.

Definition at line 282 of file client.c.

References ISC_FALSE, isc_interval_set(), ISC_LOG_ERROR, ISC_R_SUCCESS, isc_result_totext(), isc_timer_reset(), isc_timertype_once, ISC_TRUE, ns_client_log(), NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_CLIENT, ns_client::timer, and ns_client::timerset.

Referenced by client_read(), client_request(), and query_recurse().

isc_result_t ns_clientmgr_create ( isc_mem_t mctx,
isc_taskmgr_t taskmgr,
isc_timermgr_t timermgr,
ns_clientmgr_t **  managerp 
)

Set a timer in the client to go off in the specified amount of time.

Definition at line 3080 of file client.c.

References ns_clientmgr::clients, ns_clientmgr::exiting, ns_clientmgr::inactive, ISC_FALSE, ISC_LIST_INIT, isc_mem_get, isc_mem_put, isc_mutex_destroy, isc_mutex_init, ISC_QUEUE_INIT, ISC_R_NOMEMORY, ISC_R_SUCCESS, ns_clientmgr::listlock, ns_clientmgr::lock, ns_clientmgr::magic, MANAGER_MAGIC, ns_clientmgr::mctx, MTRACE, NMCTXS, ns_clientmgr::reclock, ns_clientmgr::recursing, ns_clientmgr::taskmgr, and ns_clientmgr::timermgr.

Referenced by ns_interface_create().

void ns_clientmgr_destroy ( ns_clientmgr_t **  managerp  ) 

Create a client manager.

Definition at line 3138 of file client.c.

References clientmgr_destroy(), ns_clientmgr::clients, ns_clientmgr::exiting, ISC_FALSE, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, isc_task_beginexclusive(), isc_task_endexclusive(), isc_task_shutdown(), ISC_TRUE, MTRACE, REQUIRE, ns_client::task, and VALID_MANAGER.

Referenced by ns_interface_shutdown().

isc_result_t ns_clientmgr_createclients ( ns_clientmgr_t manager,
unsigned int  n,
ns_interface_t ifp,
isc_boolean_t  tcp 
)

Destroy a client manager and all ns_client_t objects managed by it.

Definition at line 3310 of file client.c.

References get_client(), ISC_R_SUCCESS, MTRACE, REQUIRE, ns_interface::udpdispatch, and VALID_MANAGER.

Referenced by ns_interface_accepttcp(), and ns_interface_listenudp().

isc_sockaddr_t* ns_client_getsockaddr ( ns_client_t client  ) 

Create up to 'n' clients listening on interface 'ifp'. If 'tcp' is ISC_TRUE, the clients will listen for TCP connections, otherwise for UDP requests.

Definition at line 3331 of file client.c.

References ns_client::peeraddr.

Referenced by ns_notify_start().

isc_result_t ns_client_checkaclsilent ( ns_client_t client,
isc_netaddr_t netaddr,
dns_acl_t acl,
isc_boolean_t  default_allow 
)

Get the socket address of the client whose request is currently being processed.

Definition at line 3336 of file client.c.

References ns_client::attributes, dns_acl_match2(), DNS_R_REFUSED, ns_client::ecs_addr, ns_client::ecs_addrlen, isc_netaddr_fromsockaddr(), ISC_R_SUCCESS, match(), NS_CLIENTATTR_HAVEECS, ns_client::peeraddr, and ns_client::signer.

Referenced by checkqueryacl(), checkupdateacl(), client_request(), ns_client_checkacl(), query_find(), query_getcachedb(), query_validatezonedb(), and redirect().

isc_result_t ns_client_checkacl ( ns_client_t client,
isc_sockaddr_t sockaddr,
const char *  opname,
dns_acl_t acl,
isc_boolean_t  default_allow,
int  log_level 
)

Convenience function for client request ACL checking.

Check the current client request against 'acl'. If 'acl' is NULL, allow the request iff 'default_allow' is ISC_TRUE. If netaddr is NULL, check the ACL against client->peeraddr; otherwise check it against netaddr.

Notes:

Requires: Returns:

Definition at line 3381 of file client.c.

References DNS_LOGCATEGORY_SECURITY, ISC_LOG_DEBUG, isc_netaddr_fromsockaddr(), ISC_R_SUCCESS, ns_client_checkaclsilent(), ns_client_log(), and NS_LOGMODULE_CLIENT.

Referenced by ns_xfr_start().

void ns_client_log ( ns_client_t client,
isc_logcategory_t category,
isc_logmodule_t module,
int  level,
const char *  fmt,
  ... 
)

Like ns_client_checkaclsilent, except the outcome of the check is logged at log level 'log_level' if denied, and at debug 3 if approved. Log messages will refer to the request as an 'opname' request.

Requires:

void void ns_client_logv ( ns_client_t client,
isc_logcategory_t category,
isc_logmodule_t module,
int  level,
const char *  fmt,
va_list  ap 
)

void void void ns_client_aclmsg ( const char *  msg,
dns_name_t name,
dns_rdatatype_t  type,
dns_rdataclass_t  rdclass,
char *  buf,
size_t  len 
)

Definition at line 3472 of file client.c.

References dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, and namebuf.

Referenced by ns_xfr_start(), query_getcachedb(), and query_validatezonedb().

void ns_client_recursing ( ns_client_t client  ) 

Definition at line 256 of file client.c.

References ISC_LIST_APPEND, LOCK, ns_client::manager, ns_client::newstate, NS_CLIENT_VALID, NS_CLIENTSTATE_RECURSING, NS_CLIENTSTATE_WORKING, ns_clientmgr::reclock, ns_clientmgr::recursing, REQUIRE, ns_client::state, and UNLOCK.

Referenced by query_recurse().

void ns_client_killoldestquery ( ns_client_t client  ) 

Add client to end of th recursing list.

Definition at line 267 of file client.c.

References ISC_LIST_HEAD, ISC_LIST_UNLINK, LOCK, ns_client::manager, NS_CLIENT_VALID, ns_query_cancel(), ns_clientmgr::reclock, ns_clientmgr::recursing, REQUIRE, and UNLOCK.

Referenced by query_recurse().

void ns_client_dumprecursing ( FILE *  f,
ns_clientmgr_t manager 
)

Kill the oldest recursive query (recursing list head).

Definition at line 3525 of file client.c.

References dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, ns_query::fetchlock, dns_message::id, INSIST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_SOCKADDR_FORMATSIZE, LOCK, ns_client::message, dns_view::name, name, namebuf, ns_client_name(), NS_CLIENTSTATE_RECURSING, ns_query::origqname, ns_query::qname, ns_client::query, dns_rdataset::rdclass, ns_clientmgr::reclock, ns_clientmgr::recursing, ns_client::requesttime, REQUIRE, ns_client::state, dns_rdataset::type, UNLOCK, VALID_MANAGER, and ns_client::view.

Referenced by ns_interfacemgr_dumprecursing().

void ns_client_qnamereplace ( ns_client_t client,
dns_name_t name 
)

Dump the outstanding recursive queries to 'f'.

Definition at line 3590 of file client.c.

References ns_query::attributes, dns_message_puttempname(), ns_query::fetchlock, LOCK, ns_client::message, NS_QUERYATTR_REDIRECT, ns_query::qname, ns_client::query, ns_query::restarts, and UNLOCK.

Referenced by query_find(), and rpz_add_cname().

isc_boolean_t ns_client_isself ( dns_view_t myview,
dns_tsigkey_t mykey,
isc_sockaddr_t srcaddr,
isc_sockaddr_t destaddr,
dns_rdataclass_t  rdclass,
void *  arg 
)

Replace the qname.

Definition at line 1573 of file client.c.

References allowed(), dns_tsigkey_detach(), dns_tsigkey_identity, dns_view_gettsig(), dst_key_compare(), ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_netaddr_fromsockaddr(), ISC_R_SUCCESS, ISC_TF, ISC_TRUE, dns_tsigkey::key, key, match(), dns_view::matchclients, dns_view::matchdestinations, dns_view::matchrecursiveonly, dns_tsigkey::name, ns_interfacemgr_listeningon(), dns_view::rdclass, and UNUSED.

Referenced by ns_zone_configure().

isc_result_t ns_client_sourceip ( dns_clientinfo_t ci,
isc_sockaddr_t **  addrp 
)

Isself callback.

Definition at line 3605 of file client.c.

References dns_clientinfo::data, ISC_R_SUCCESS, NS_CLIENT_VALID, ns_client::peeraddr, and REQUIRE.

Referenced by foreach_rr(), foreach_rrset(), get_key(), mark_secure(), query_addadditional(), query_addadditional2(), query_addbestns(), query_addns(), query_addsoa(), query_addwildcardproof(), query_find(), query_findclosestnsec3(), query_getdb(), redirect(), redirect2(), rpz_find_p(), and rpz_rrset_find().

isc_result_t ns_client_addopt ( ns_client_t client,
dns_message_t message,
dns_rdataset_t **  opt 
)

Definition at line 1428 of file client.c.

References AF_INET6, ns_client::attributes, dns_ednsopt::code, DNS_EDNSOPTIONS, dns_message_buildopt(), DNS_MESSAGEEXTFLAG_REPLYPRESERVE, DNS_OPT_CLIENT_SUBNET, DNS_OPT_EXPIRE, DNS_OPT_NSID, DNS_OPT_SIT, dns_resolver_getudpsize(), ns_client::ecs_addr, ns_client::ecs_addrlen, ns_client::ecs_scope, ECS_SIZE, ednsopts, ns_client::expire, ns_client::extflags, isc_netaddr::family, INSIST, isc_buffer_init, isc_buffer_putuint16, isc_buffer_putuint32, isc_buffer_putuint8, ISC_R_SUCCESS, isc_random_get(), isc_stdtime_get(), dns_ednsopt::length, now, NS_CLIENT_VALID, NS_CLIENTATTR_HAVEECS, NS_CLIENTATTR_HAVEEXPIRE, NS_CLIENTATTR_WANTNSID, NS_CLIENTATTR_WANTSIT, ns_os_gethostname(), REQUIRE, dns_view::resolver, SIT_SIZE, isc_netaddr::type, dns_ednsopt::value, and ns_client::view.

Referenced by client_send(), process_opt(), and sendstream().


Variable Documentation

unsigned int ns_client_requests

Definition at line 232 of file client.c.

Referenced by client_request(), and pps_timer_tick().


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