hesiod.h revision 93032
165532Snectar/*	$NetBSD: hesiod.h,v 1.3 1999/01/24 23:53:18 lukem Exp $	*/
265532Snectar/*	$FreeBSD: head/include/hesiod.h 93032 2002-03-23 17:24:55Z imp $ */
365532Snectar
465532Snectar
565532Snectar/*-
665532Snectar * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
765532Snectar * All rights reserved.
865532Snectar *
965532Snectar * Redistribution and use in source and binary forms, with or without
1065532Snectar * modification, are permitted provided that the following conditions
1165532Snectar * are met:
1265532Snectar * 1. Redistributions of source code must retain the above copyright
1365532Snectar *    notice, this list of conditions and the following disclaimer.
1465532Snectar * 2. Redistributions in binary form must reproduce the above copyright
1565532Snectar *    notice, this list of conditions and the following disclaimer in the
1665532Snectar *    documentation and/or other materials provided with the distribution.
1765532Snectar * 3. All advertising materials mentioning features or use of this software
1865532Snectar *    must display the following acknowledgement:
1965532Snectar *        This product includes software developed by the NetBSD
2065532Snectar *        Foundation, Inc. and its contributors.
2165532Snectar * 4. Neither the name of The NetBSD Foundation nor the names of its
2265532Snectar *    contributors may be used to endorse or promote products derived
2365532Snectar *    from this software without specific prior written permission.
2465532Snectar *
2565532Snectar * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2665532Snectar * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2765532Snectar * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2865532Snectar * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2965532Snectar * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3065532Snectar * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3165532Snectar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3265532Snectar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3365532Snectar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3465532Snectar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3565532Snectar * POSSIBILITY OF SUCH DAMAGE.
3665532Snectar */
3765532Snectar
3865532Snectar/*
3965532Snectar * Copyright (c) 1996 by Internet Software Consortium.
4065532Snectar *
4165532Snectar * Permission to use, copy, modify, and distribute this software for any
4265532Snectar * purpose with or without fee is hereby granted, provided that the above
4365532Snectar * copyright notice and this permission notice appear in all copies.
4465532Snectar *
4565532Snectar * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
4665532Snectar * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
4765532Snectar * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
4865532Snectar * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
4965532Snectar * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
5065532Snectar * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
5165532Snectar * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
5265532Snectar * SOFTWARE.
5365532Snectar */
5465532Snectar
5565532Snectar#ifndef _HESIOD_H_
5665532Snectar#define _HESIOD_H_
5765532Snectar
5865532Snectar	/* Application-visible indication that we have the new interfaces */
5965532Snectar
6065532Snectar#define HESIOD_INTERFACES
6165532Snectar
6265532Snectar	/* Configuration information. */
6365532Snectar
6465532Snectar#ifndef _PATH_HESIOD_CONF			/* Configuration file. */
6565532Snectar#define _PATH_HESIOD_CONF	"/etc/hesiod.conf"
6665532Snectar#endif
6765532Snectar
6865532Snectar#define DEF_RHS		""			/* Defaults if HESIOD_CONF */
6965532Snectar#define DEF_LHS		""			/*    file is not present. */
7065532Snectar
7165532Snectar	/* Error codes (for backwards compatibility) */
7265532Snectar
7365532Snectar#define	HES_ER_UNINIT	-1	/* uninitialized */
7465532Snectar#define	HES_ER_OK	0	/* no error */
7565532Snectar#define	HES_ER_NOTFOUND	1	/* Hesiod name not found by server */
7665532Snectar#define HES_ER_CONFIG	2	/* local problem (no config file?) */
7765532Snectar#define HES_ER_NET	3	/* network problem */
7865532Snectar
7965532Snectar	/* Declaration of routines */
8065532Snectar
8165532Snectar#include <sys/cdefs.h>
8265532Snectar
8365532Snectar__BEGIN_DECLS
8493032Simpint	hesiod_init(void **);
8593032Simpchar  **hesiod_resolve(void *, const char *, const char *);
8693032Simpvoid	hesiod_free_list(void *, char **);
8793032Simpchar   *hesiod_to_bind(void *, const char *, const char *);
8893032Simpvoid	hesiod_end(void *);
8965532Snectar
9065532Snectar				/* backwards compatibility */
9193032Simpint	hes_init(void);
9293032Simpchar   *hes_to_bind(const char *, const char *);
9393032Simpchar  **hes_resolve(const char *, const char *);
9493032Simpint	hes_error(void);
9593032Simpvoid	hes_free(char **);
9665532Snectar__END_DECLS
9765532Snectar
9865532Snectar#endif /* ! _HESIOD_H_ */
99