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: lwsearch.h,v 1.4.208.1 2004/03/06 10:21:25 marka Exp $ */
20 #ifndef NAMED_LWSEARCH_H
21 #define NAMED_LWSEARCH_H 1
23 #include <isc/mutex.h>
24 #include <isc/result.h>
25 #include <isc/types.h>
27 #include <dns/types.h>
29 #include <named/types.h>
32 * Lightweight resolver search list types and routines.
34 * An ns_lwsearchlist_t holds a list of search path elements.
36 * An ns_lwsearchctx stores the state of search list during a lookup
40 struct ns_lwsearchlist {
49 struct ns_lwsearchctx {
51 dns_name_t *searchname;
53 ns_lwsearchlist_t *list;
54 isc_boolean_t doneexact;
55 isc_boolean_t exactfirst;
59 ns_lwsearchlist_create(isc_mem_t *mctx, ns_lwsearchlist_t **listp);
61 * Create an empty search list object.
65 ns_lwsearchlist_attach(ns_lwsearchlist_t *source, ns_lwsearchlist_t **target);
67 * Attach to a search list object.
71 ns_lwsearchlist_detach(ns_lwsearchlist_t **listp);
73 * Detach from a search list object.
77 ns_lwsearchlist_append(ns_lwsearchlist_t *list, dns_name_t *name);
79 * Append an element to a search list. This creates a copy of the name.
83 ns_lwsearchctx_init(ns_lwsearchctx_t *sctx, ns_lwsearchlist_t *list,
84 dns_name_t *name, unsigned int ndots);
86 * Creates a search list context structure.
90 ns_lwsearchctx_first(ns_lwsearchctx_t *sctx);
92 * Moves the search list context iterator to the first element, which
93 * is usually the exact name.
97 ns_lwsearchctx_next(ns_lwsearchctx_t *sctx);
99 * Moves the search list context iterator to the next element.
103 ns_lwsearchctx_current(ns_lwsearchctx_t *sctx, dns_name_t *absname);
105 * Obtains the current name to be looked up. This involves either
106 * concatenating the name with a search path element, making an
107 * exact name absolute, or doing nothing.
110 #endif /* NAMED_LWSEARCH_H */