1/*	$NetBSD: hesiod.h,v 1.5 2008/04/28 20:22:54 martin Exp $	*/
2
3/*-
4 * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * Copyright (c) 1996 by Internet Software Consortium.
31 *
32 * Permission to use, copy, modify, and distribute this software for any
33 * purpose with or without fee is hereby granted, provided that the above
34 * copyright notice and this permission notice appear in all copies.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
37 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
38 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
39 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
40 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
41 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
42 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
43 */
44
45#ifndef _HESIOD_H_
46#define _HESIOD_H_
47
48	/* Application-visible indication that we have the new interfaces */
49
50#define HESIOD_INTERFACES
51
52	/* Configuration information. */
53
54#ifndef _PATH_HESIOD_CONF			/* Configuration file. */
55#define _PATH_HESIOD_CONF	"/etc/hesiod.conf"
56#endif
57
58#define DEF_RHS		""			/* Defaults if HESIOD_CONF */
59#define DEF_LHS		""			/*    file is not present. */
60
61	/* Error codes (for backwards compatibility) */
62
63#define	HES_ER_UNINIT	-1	/* uninitialized */
64#define	HES_ER_OK	0	/* no error */
65#define	HES_ER_NOTFOUND	1	/* Hesiod name not found by server */
66#define HES_ER_CONFIG	2	/* local problem (no config file?) */
67#define HES_ER_NET	3	/* network problem */
68
69	/* Declaration of routines */
70
71#include <sys/cdefs.h>
72
73__BEGIN_DECLS
74int	hesiod_init	(void **);
75char  **hesiod_resolve	(void *, const char *, const char *);
76void	hesiod_free_list(void *, char **);
77char   *hesiod_to_bind	(void *, const char *, const char *);
78void	hesiod_end	(void *);
79
80				/* backwards compatibility */
81int	hes_init	(void);
82char   *hes_to_bind	(const char *, const char *);
83char  **hes_resolve	(const char *, const char *);
84int	hes_error	(void);
85void	hes_free	(char **);
86__END_DECLS
87
88#endif /* ! _HESIOD_H_ */
89