request.c revision ffff5d67926821d3db8df63bdd84a9cb1ce56739
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * Copyright (C) 2000-2002 Internet Software Consortium.
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * Permission to use, copy, modify, and/or distribute this software for any
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * purpose with or without fee is hereby granted, provided that the above
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * copyright notice and this permission notice appear in all copies.
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer * PERFORMANCE OF THIS SOFTWARE.
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer#define REQUESTMGR_MAGIC ISC_MAGIC('R', 'q', 'u', 'M')
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer#define VALID_REQUESTMGR(mgr) ISC_MAGIC_VALID(mgr, REQUESTMGR_MAGIC)
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer#define REQUEST_MAGIC ISC_MAGIC('R', 'q', 'u', '!')
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer#define VALID_REQUEST(request) ISC_MAGIC_VALID(request, REQUEST_MAGIC)
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyertypedef ISC_LIST(dns_request_t) dns_requestlist_t;
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer unsigned int magic;
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer unsigned int hash;
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer unsigned int magic;
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer unsigned int hash;
02fdafbf53f712ee72ef50c4fa537f97082d8114Michael Sawyer isc_boolean_t canceling; /* ctlevent outstanding */
#define DNS_REQUEST_CANCELED(r) \
#define DNS_REQUEST_CONNECTING(r) \
#define DNS_REQUEST_SENDING(r) \
#define DNS_REQUEST_TIMEDOUT(r) \
unsigned int dispattr;
return (ISC_R_NOMEMORY);
return (result);
for (i = 0; i < DNS_REQUEST_NLOCKS; i++) {
return (result);
return (ISC_R_SUCCESS);
if (need_destroy)
if (need_destroy)
for (i = 0; i < DNS_REQUEST_NLOCKS; i++)
static inline isc_result_t
isc_region_t r;
* as we do in resolver.c, but we prefer implementation simplicity
return (result);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static isc_boolean_t
int match;
match > 0)
if (drop) {
return (drop);
static isc_result_t
unsigned int attrs;
return (result);
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
goto cleanup;
attrs = 0;
return (result);
static isc_result_t
case PF_INET:
case PF_INET6:
return (ISC_R_NOTIMPLEMENTED);
return (ISC_R_FAMILYNOSUPPORT);
return (ISC_R_SUCCESS);
attrs = 0;
case PF_INET:
case PF_INET6:
return (ISC_R_NOTIMPLEMENTED);
attrmask = 0;
dispatchp));
static isc_result_t
if (tcp)
return (result);
static isc_result_t
return (result);
unsigned int udpretries = 0;
if (udptimeout != 0)
requestp));
isc_region_t r;
return (DNS_R_BLACKHOLED);
return (result);
if (udptimeout == 0)
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
if (tcp)
goto cleanup;
if (tcp)
goto cleanup;
goto unlink;
if (tcp) {
goto unlink;
goto unlink;
request);
return (ISC_R_SUCCESS);
return (result);
unsigned int udpretries = 0;
if (udptimeout != 0)
requestp));
return (ISC_R_FAMILYMISMATCH);
return (DNS_R_BLACKHOLED);
return (result);
if (udptimeout == 0)
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
if (setkey) {
goto cleanup;
goto use_tcp;
goto cleanup;
goto cleanup;
goto cleanup;
goto unlink;
if (tcp) {
goto unlink;
goto unlink;
request);
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
isc_region_t r;
return (result);
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
if (tcp)
goto cleanup;
return (ISC_R_SUCCESS);
if (cleanup_cctx)
return (result);
unsigned int options)
request);
return (result);
return (result);
return (result);
return (result);
static isc_socket_t *
unsigned int dispattr;
return (socket);
isc_region_t r;
goto done;
r.length);
goto done;
done:
unsigned int dispattr;