lwsearch.h revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 2000, 2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and/or distribute this software for any
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * purpose with or without fee is hereby granted, provided that the above
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater/* $Id: lwsearch.h,v 1.9 2007/06/19 23:46:59 tbox Exp $ */
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Lightweight resolver search list types and routines.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * An ns_lwsearchlist_t holds a list of search path elements.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * An ns_lwsearchctx stores the state of search list during a lookup
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*% An ns_lwsearchlist_t holds a list of search path elements. */
28fc90e6c81338c5f34e065fdda49d320e362583Mark Andrews unsigned int magic;
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington unsigned int refs;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*% An ns_lwsearchctx stores the state of search list during a lookup operation. */
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchlist_create(isc_mem_t *mctx, ns_lwsearchlist_t **listp);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Create an empty search list object.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchlist_attach(ns_lwsearchlist_t *source, ns_lwsearchlist_t **target);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Attach to a search list object.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchlist_detach(ns_lwsearchlist_t **listp);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Detach from a search list object.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchlist_append(ns_lwsearchlist_t *list, dns_name_t *name);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Append an element to a search list. This creates a copy of the name.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchctx_init(ns_lwsearchctx_t *sctx, ns_lwsearchlist_t *list,
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Creates a search list context structure.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchctx_first(ns_lwsearchctx_t *sctx);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Moves the search list context iterator to the first element, which
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * is usually the exact name.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchctx_next(ns_lwsearchctx_t *sctx);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Moves the search list context iterator to the next element.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellingtonns_lwsearchctx_current(ns_lwsearchctx_t *sctx, dns_name_t *absname);
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * Obtains the current name to be looked up. This involves either
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * concatenating the name with a search path element, making an
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington * exact name absolute, or doing nothing.
38379c5c5e07535f6a8934e6088f475534390405Brian Wellington#endif /* NAMED_LWSEARCH_H */