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