Add BIND 9.2.4rc7.
[dragonfly.git] / contrib / bind-9.2.4rc7 / lib / dns / include / dns / lookup.h
blob9b707235906d72ebb57bed1a9c9bb3b8f4ca9ae9
1 /*
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 $ */
20 #ifndef DNS_LOOKUP_H
21 #define DNS_LOOKUP_H 1
23 /*****
24 ***** Module Info
25 *****/
28 * DNS Lookup
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.
34 * MP:
35 * The module ensures appropriate synchronization of data structures it
36 * creates and manipulates.
38 * Reliability:
39 * No anticipated impact.
41 * Resources:
42 * <TBS>
44 * Security:
45 * No anticipated impact.
47 * Standards:
48 * RFCs: 1034, 1035, 2181, <TBS>
49 * Drafts: <TBS>
52 #include <isc/lang.h>
53 #include <isc/event.h>
55 #include <dns/types.h>
57 ISC_LANG_BEGINDECLS
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);
68 isc_result_t result;
69 dns_name_t *name;
70 dns_rdataset_t *rdataset;
71 dns_rdataset_t *sigrdataset;
72 dns_db_t *db;
73 dns_dbnode_t *node;
74 } dns_lookupevent_t;
76 isc_result_t
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'.
83 * Requires:
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
95 * Returns:
97 * ISC_R_SUCCESS
98 * ISC_R_NOMEMORY
100 * Any resolver-related error (e.g. ISC_R_SHUTTINGDOWN) may also be
101 * returned.
104 void
105 dns_lookup_cancel(dns_lookup_t *lookup);
107 * Cancel 'lookup'.
109 * Notes:
111 * If 'lookup' has not completed, post its LOOKUPDONE event with a
112 * result code of ISC_R_CANCELED.
114 * Requires:
116 * 'lookup' is a valid lookup.
119 void
120 dns_lookup_destroy(dns_lookup_t **lookupp);
122 * Destroy 'lookup'.
124 * Requires:
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).
131 * Ensures:
133 * *lookupp == NULL.
136 ISC_LANG_ENDDECLS
138 #endif /* DNS_LOOKUP_H */