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