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 /*- 6248aee62SJacques Vidrine * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. 7248aee62SJacques Vidrine * All rights reserved. 8248aee62SJacques Vidrine * 9248aee62SJacques Vidrine * Redistribution and use in source and binary forms, with or without 10248aee62SJacques Vidrine * modification, are permitted provided that the following conditions 11248aee62SJacques Vidrine * are met: 12248aee62SJacques Vidrine * 1. Redistributions of source code must retain the above copyright 13248aee62SJacques Vidrine * notice, this list of conditions and the following disclaimer. 14248aee62SJacques Vidrine * 2. Redistributions in binary form must reproduce the above copyright 15248aee62SJacques Vidrine * notice, this list of conditions and the following disclaimer in the 16248aee62SJacques Vidrine * documentation and/or other materials provided with the distribution. 17248aee62SJacques Vidrine * 3. All advertising materials mentioning features or use of this software 18248aee62SJacques Vidrine * must display the following acknowledgement: 19248aee62SJacques Vidrine * This product includes software developed by the NetBSD 20248aee62SJacques Vidrine * Foundation, Inc. and its contributors. 21248aee62SJacques Vidrine * 4. Neither the name of The NetBSD Foundation nor the names of its 22248aee62SJacques Vidrine * contributors may be used to endorse or promote products derived 23248aee62SJacques Vidrine * from this software without specific prior written permission. 24248aee62SJacques Vidrine * 25248aee62SJacques Vidrine * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26248aee62SJacques Vidrine * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27248aee62SJacques Vidrine * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28248aee62SJacques Vidrine * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29248aee62SJacques Vidrine * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30248aee62SJacques Vidrine * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31248aee62SJacques Vidrine * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32248aee62SJacques Vidrine * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33248aee62SJacques Vidrine * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34248aee62SJacques Vidrine * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35248aee62SJacques Vidrine * POSSIBILITY OF SUCH DAMAGE. 36248aee62SJacques Vidrine */ 37248aee62SJacques Vidrine 38248aee62SJacques Vidrine /* 39248aee62SJacques Vidrine * Copyright (c) 1996 by Internet Software Consortium. 40248aee62SJacques Vidrine * 41248aee62SJacques Vidrine * Permission to use, copy, modify, and distribute this software for any 42248aee62SJacques Vidrine * purpose with or without fee is hereby granted, provided that the above 43248aee62SJacques Vidrine * copyright notice and this permission notice appear in all copies. 44248aee62SJacques Vidrine * 45248aee62SJacques Vidrine * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS 46248aee62SJacques Vidrine * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 47248aee62SJacques Vidrine * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE 48248aee62SJacques Vidrine * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 49248aee62SJacques Vidrine * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 50248aee62SJacques Vidrine * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 51248aee62SJacques Vidrine * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 52248aee62SJacques Vidrine * SOFTWARE. 53248aee62SJacques Vidrine */ 54248aee62SJacques Vidrine 55248aee62SJacques Vidrine #ifndef _HESIOD_H_ 56248aee62SJacques Vidrine #define _HESIOD_H_ 57248aee62SJacques Vidrine 58248aee62SJacques Vidrine /* Application-visible indication that we have the new interfaces */ 59248aee62SJacques Vidrine 60248aee62SJacques Vidrine #define HESIOD_INTERFACES 61248aee62SJacques Vidrine 62248aee62SJacques Vidrine /* Configuration information. */ 63248aee62SJacques Vidrine 64248aee62SJacques Vidrine #ifndef _PATH_HESIOD_CONF /* Configuration file. */ 65248aee62SJacques Vidrine #define _PATH_HESIOD_CONF "/etc/hesiod.conf" 66248aee62SJacques Vidrine #endif 67248aee62SJacques Vidrine 68248aee62SJacques Vidrine #define DEF_RHS "" /* Defaults if HESIOD_CONF */ 69248aee62SJacques Vidrine #define DEF_LHS "" /* file is not present. */ 70248aee62SJacques Vidrine 71248aee62SJacques Vidrine /* Error codes (for backwards compatibility) */ 72248aee62SJacques Vidrine 73248aee62SJacques Vidrine #define HES_ER_UNINIT -1 /* uninitialized */ 74248aee62SJacques Vidrine #define HES_ER_OK 0 /* no error */ 75248aee62SJacques Vidrine #define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */ 76248aee62SJacques Vidrine #define HES_ER_CONFIG 2 /* local problem (no config file?) */ 77248aee62SJacques Vidrine #define HES_ER_NET 3 /* network problem */ 78248aee62SJacques Vidrine 79248aee62SJacques Vidrine /* Declaration of routines */ 80248aee62SJacques Vidrine 81248aee62SJacques Vidrine #include <sys/cdefs.h> 82248aee62SJacques Vidrine 83248aee62SJacques Vidrine __BEGIN_DECLS 84bb28f3c2SWarner Losh int hesiod_init(void **); 85bb28f3c2SWarner Losh char **hesiod_resolve(void *, const char *, const char *); 86bb28f3c2SWarner Losh void hesiod_free_list(void *, char **); 87bb28f3c2SWarner Losh char *hesiod_to_bind(void *, const char *, const char *); 88bb28f3c2SWarner Losh void hesiod_end(void *); 89248aee62SJacques Vidrine 90248aee62SJacques Vidrine /* backwards compatibility */ 91bb28f3c2SWarner Losh int hes_init(void); 92bb28f3c2SWarner Losh char *hes_to_bind(const char *, const char *); 93bb28f3c2SWarner Losh char **hes_resolve(const char *, const char *); 94bb28f3c2SWarner Losh int hes_error(void); 95bb28f3c2SWarner Losh void hes_free(char **); 96248aee62SJacques Vidrine __END_DECLS 97248aee62SJacques Vidrine 98248aee62SJacques Vidrine #endif /* ! _HESIOD_H_ */ 99