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