2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2000, 2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
18 /* $Id: lookup.h,v 1.5.2.1 2004/03/09 06:11:17 marka Exp $ */
21 #define DNS_LOOKUP_H 1
30 * The lookup module performs simple DNS lookups. It implements
31 * the full resolver algorithm, both looking for local data and
32 * resoving external names as necessary.
35 * The module ensures appropriate synchronization of data structures it
36 * creates and manipulates.
39 * No anticipated impact.
45 * No anticipated impact.
48 * RFCs: 1034, 1035, 2181, <TBS>
53 #include <isc/event.h>
55 #include <dns/types.h>
60 * A 'dns_lookupevent_t' is returned when a lookup completes.
61 * The sender field will be set to the lookup that completed. If 'result'
62 * is ISC_R_SUCCESS, then 'names' will contain a list of names associated
63 * with the address. The recipient of the event must not change the list
64 * and must not refer to any of the name data after the event is freed.
66 typedef struct dns_lookupevent
{
67 ISC_EVENT_COMMON(struct dns_lookupevent
);
70 dns_rdataset_t
*rdataset
;
71 dns_rdataset_t
*sigrdataset
;
77 dns_lookup_create(isc_mem_t
*mctx
, dns_name_t
*name
, dns_rdatatype_t type
,
78 dns_view_t
*view
, unsigned int options
, isc_task_t
*task
,
79 isc_taskaction_t action
, void *arg
, dns_lookup_t
**lookupp
);
81 * Finds the rrsets matching 'name' and 'type'.
85 * 'mctx' is a valid mctx.
87 * 'name' is a valid name.
89 * 'view' is a valid view which has a resolver.
91 * 'task' is a valid task.
93 * lookupp != NULL && *lookupp == NULL
100 * Any resolver-related error (e.g. ISC_R_SHUTTINGDOWN) may also be
105 dns_lookup_cancel(dns_lookup_t
*lookup
);
111 * If 'lookup' has not completed, post its LOOKUPDONE event with a
112 * result code of ISC_R_CANCELED.
116 * 'lookup' is a valid lookup.
120 dns_lookup_destroy(dns_lookup_t
**lookupp
);
126 * '*lookupp' is a valid lookup.
128 * The caller has received the LOOKUPDONE event (either because the
129 * lookup completed or because dns_lookup_cancel() was called).
138 #endif /* DNS_LOOKUP_H */