xref: /freebsd/include/hesiod.h (revision b61a573019428cbdc38ed03be9ecd2482011ea66)
1248aee62SJacques Vidrine /*	$NetBSD: hesiod.h,v 1.3 1999/01/24 23:53:18 lukem Exp $	*/
2248aee62SJacques Vidrine /*	$FreeBSD$ */
3248aee62SJacques Vidrine 
4248aee62SJacques Vidrine 
5248aee62SJacques Vidrine /*-
6*b61a5730SWarner Losh  * SPDX-License-Identifier: (BSD-2-Clause AND ISC)
7e58eb3c4SPedro F. Giffuni  *
8248aee62SJacques Vidrine  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
9248aee62SJacques Vidrine  * All rights reserved.
10248aee62SJacques Vidrine  *
11248aee62SJacques Vidrine  * Redistribution and use in source and binary forms, with or without
12248aee62SJacques Vidrine  * modification, are permitted provided that the following conditions
13248aee62SJacques Vidrine  * are met:
14248aee62SJacques Vidrine  * 1. Redistributions of source code must retain the above copyright
15248aee62SJacques Vidrine  *    notice, this list of conditions and the following disclaimer.
16248aee62SJacques Vidrine  * 2. Redistributions in binary form must reproduce the above copyright
17248aee62SJacques Vidrine  *    notice, this list of conditions and the following disclaimer in the
18248aee62SJacques Vidrine  *    documentation and/or other materials provided with the distribution.
19248aee62SJacques Vidrine  *
20248aee62SJacques Vidrine  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21248aee62SJacques Vidrine  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22248aee62SJacques Vidrine  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23248aee62SJacques Vidrine  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24248aee62SJacques Vidrine  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25248aee62SJacques Vidrine  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26248aee62SJacques Vidrine  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27248aee62SJacques Vidrine  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28248aee62SJacques Vidrine  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29248aee62SJacques Vidrine  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30248aee62SJacques Vidrine  * POSSIBILITY OF SUCH DAMAGE.
31248aee62SJacques Vidrine  */
32248aee62SJacques Vidrine 
33248aee62SJacques Vidrine /*
34248aee62SJacques Vidrine  * Copyright (c) 1996 by Internet Software Consortium.
35248aee62SJacques Vidrine  *
36248aee62SJacques Vidrine  * Permission to use, copy, modify, and distribute this software for any
37248aee62SJacques Vidrine  * purpose with or without fee is hereby granted, provided that the above
38248aee62SJacques Vidrine  * copyright notice and this permission notice appear in all copies.
39248aee62SJacques Vidrine  *
40248aee62SJacques Vidrine  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
41248aee62SJacques Vidrine  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
42248aee62SJacques Vidrine  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
43248aee62SJacques Vidrine  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
44248aee62SJacques Vidrine  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
45248aee62SJacques Vidrine  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
46248aee62SJacques Vidrine  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47248aee62SJacques Vidrine  * SOFTWARE.
48248aee62SJacques Vidrine  */
49248aee62SJacques Vidrine 
50248aee62SJacques Vidrine #ifndef _HESIOD_H_
51248aee62SJacques Vidrine #define _HESIOD_H_
52248aee62SJacques Vidrine 
53248aee62SJacques Vidrine 	/* Application-visible indication that we have the new interfaces */
54248aee62SJacques Vidrine 
55248aee62SJacques Vidrine #define HESIOD_INTERFACES
56248aee62SJacques Vidrine 
57248aee62SJacques Vidrine 	/* Configuration information. */
58248aee62SJacques Vidrine 
59248aee62SJacques Vidrine #ifndef _PATH_HESIOD_CONF			/* Configuration file. */
60248aee62SJacques Vidrine #define _PATH_HESIOD_CONF	"/etc/hesiod.conf"
61248aee62SJacques Vidrine #endif
62248aee62SJacques Vidrine 
63248aee62SJacques Vidrine #define DEF_RHS		""			/* Defaults if HESIOD_CONF */
64248aee62SJacques Vidrine #define DEF_LHS		""			/*    file is not present. */
65248aee62SJacques Vidrine 
66248aee62SJacques Vidrine 	/* Error codes (for backwards compatibility) */
67248aee62SJacques Vidrine 
68248aee62SJacques Vidrine #define	HES_ER_UNINIT	-1	/* uninitialized */
69248aee62SJacques Vidrine #define	HES_ER_OK	0	/* no error */
70248aee62SJacques Vidrine #define	HES_ER_NOTFOUND	1	/* Hesiod name not found by server */
71248aee62SJacques Vidrine #define HES_ER_CONFIG	2	/* local problem (no config file?) */
72248aee62SJacques Vidrine #define HES_ER_NET	3	/* network problem */
73248aee62SJacques Vidrine 
74248aee62SJacques Vidrine 	/* Declaration of routines */
75248aee62SJacques Vidrine 
76248aee62SJacques Vidrine #include <sys/cdefs.h>
77248aee62SJacques Vidrine 
78248aee62SJacques Vidrine __BEGIN_DECLS
79bb28f3c2SWarner Losh int	hesiod_init(void **);
80bb28f3c2SWarner Losh char  **hesiod_resolve(void *, const char *, const char *);
81bb28f3c2SWarner Losh void	hesiod_free_list(void *, char **);
82bb28f3c2SWarner Losh char   *hesiod_to_bind(void *, const char *, const char *);
83bb28f3c2SWarner Losh void	hesiod_end(void *);
84248aee62SJacques Vidrine 
85248aee62SJacques Vidrine 				/* backwards compatibility */
86bb28f3c2SWarner Losh int	hes_init(void);
87bb28f3c2SWarner Losh char   *hes_to_bind(const char *, const char *);
88bb28f3c2SWarner Losh char  **hes_resolve(const char *, const char *);
89bb28f3c2SWarner Losh int	hes_error(void);
90bb28f3c2SWarner Losh void	hes_free(char **);
91248aee62SJacques Vidrine __END_DECLS
92248aee62SJacques Vidrine 
93248aee62SJacques Vidrine #endif /* ! _HESIOD_H_ */
94