Annotation of src/external/mpl/bind/dist/lib/dns/include/dns/lookup.h, Revision 1.4
1.2 christos 1: /* $NetBSD: lookup.h,v 1.1.1.6 2014/12/10 03:34:42 christos Exp $ */
1.1 christos 2:
3: /*
4: * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5: *
6: * This Source Code Form is subject to the terms of the Mozilla Public
7: * License, v. 2.0. If a copy of the MPL was not distributed with this
1.4 ! christos 8: * file, you can obtain one at https://mozilla.org/MPL/2.0/.
1.1 christos 9: *
10: * See the COPYRIGHT file distributed with this work for additional
11: * information regarding copyright ownership.
12: */
13:
14: #ifndef DNS_LOOKUP_H
15: #define DNS_LOOKUP_H 1
16:
17: /*****
1.3 christos 18: ***** Module Info
19: *****/
1.1 christos 20:
21: /*! \file dns/lookup.h
22: * \brief
23: * The lookup module performs simple DNS lookups. It implements
24: * the full resolver algorithm, both looking for local data and
25: * resolving external names as necessary.
26: *
27: * MP:
28: *\li The module ensures appropriate synchronization of data structures it
29: * creates and manipulates.
30: *
31: * Reliability:
32: *\li No anticipated impact.
33: *
34: * Resources:
35: *\li TBS
36: *
37: * Security:
38: *\li No anticipated impact.
39: *
40: * Standards:
41: *\li RFCs: 1034, 1035, 2181, TBS
42: *\li Drafts: TBS
43: */
44:
1.3 christos 45: #include <isc/event.h>
1.1 christos 46: #include <isc/lang.h>
47:
48: #include <dns/types.h>
49:
50: ISC_LANG_BEGINDECLS
51:
52: /*%
53: * A 'dns_lookupevent_t' is returned when a lookup completes.
54: * The sender field will be set to the lookup that completed. If 'result'
55: * is ISC_R_SUCCESS, then 'names' will contain a list of names associated
56: * with the address. The recipient of the event must not change the list
57: * and must not refer to any of the name data after the event is freed.
58: */
59: typedef struct dns_lookupevent {
60: ISC_EVENT_COMMON(struct dns_lookupevent);
1.3 christos 61: isc_result_t result;
62: dns_name_t * name;
63: dns_rdataset_t *rdataset;
64: dns_rdataset_t *sigrdataset;
65: dns_db_t * db;
66: dns_dbnode_t * node;
1.1 christos 67: } dns_lookupevent_t;
68:
69: isc_result_t
70: dns_lookup_create(isc_mem_t *mctx, const dns_name_t *name, dns_rdatatype_t type,
71: dns_view_t *view, unsigned int options, isc_task_t *task,
72: isc_taskaction_t action, void *arg, dns_lookup_t **lookupp);
73: /*%<
74: * Finds the rrsets matching 'name' and 'type'.
75: *
76: * Requires:
77: *
78: *\li 'mctx' is a valid mctx.
79: *
80: *\li 'name' is a valid name.
81: *
82: *\li 'view' is a valid view which has a resolver.
83: *
84: *\li 'task' is a valid task.
85: *
86: *\li lookupp != NULL && *lookupp == NULL
87: *
88: * Returns:
89: *
90: *\li ISC_R_SUCCESS
91: *\li ISC_R_NOMEMORY
92: *
93: *\li Any resolver-related error (e.g. ISC_R_SHUTTINGDOWN) may also be
94: * returned.
95: */
96:
97: void
98: dns_lookup_cancel(dns_lookup_t *lookup);
99: /*%<
100: * Cancel 'lookup'.
101: *
102: * Notes:
103: *
104: *\li If 'lookup' has not completed, post its LOOKUPDONE event with a
105: * result code of ISC_R_CANCELED.
106: *
107: * Requires:
108: *
109: *\li 'lookup' is a valid lookup.
110: */
111:
112: void
113: dns_lookup_destroy(dns_lookup_t **lookupp);
114: /*%<
115: * Destroy 'lookup'.
116: *
117: * Requires:
118: *
119: *\li '*lookupp' is a valid lookup.
120: *
121: *\li The caller has received the LOOKUPDONE event (either because the
122: * lookup completed or because dns_lookup_cancel() was called).
123: *
124: * Ensures:
125: *
126: *\li *lookupp == NULL.
127: */
128:
129: ISC_LANG_ENDDECLS
130:
131: #endif /* DNS_LOOKUP_H */
CVSweb <webmaster@jp.NetBSD.org>