165532Snectar/* $NetBSD: hesiod.h,v 1.3 1999/01/24 23:53:18 lukem Exp $ */ 265532Snectar/* $FreeBSD: releng/10.2/include/hesiod.h 203963 2010-02-16 19:28:10Z imp $ */ 365532Snectar 465532Snectar 565532Snectar/*- 665532Snectar * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. 765532Snectar * All rights reserved. 865532Snectar * 965532Snectar * Redistribution and use in source and binary forms, with or without 1065532Snectar * modification, are permitted provided that the following conditions 1165532Snectar * are met: 1265532Snectar * 1. Redistributions of source code must retain the above copyright 1365532Snectar * notice, this list of conditions and the following disclaimer. 1465532Snectar * 2. Redistributions in binary form must reproduce the above copyright 1565532Snectar * notice, this list of conditions and the following disclaimer in the 1665532Snectar * documentation and/or other materials provided with the distribution. 1765532Snectar * 1865532Snectar * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1965532Snectar * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2065532Snectar * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2165532Snectar * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2265532Snectar * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2365532Snectar * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2465532Snectar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2565532Snectar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2665532Snectar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2765532Snectar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2865532Snectar * POSSIBILITY OF SUCH DAMAGE. 2965532Snectar */ 3065532Snectar 3165532Snectar/* 3265532Snectar * Copyright (c) 1996 by Internet Software Consortium. 3365532Snectar * 3465532Snectar * Permission to use, copy, modify, and distribute this software for any 3565532Snectar * purpose with or without fee is hereby granted, provided that the above 3665532Snectar * copyright notice and this permission notice appear in all copies. 3765532Snectar * 3865532Snectar * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS 3965532Snectar * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 4065532Snectar * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE 4165532Snectar * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 4265532Snectar * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 4365532Snectar * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 4465532Snectar * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 4565532Snectar * SOFTWARE. 4665532Snectar */ 4765532Snectar 4865532Snectar#ifndef _HESIOD_H_ 4965532Snectar#define _HESIOD_H_ 5065532Snectar 5165532Snectar /* Application-visible indication that we have the new interfaces */ 5265532Snectar 5365532Snectar#define HESIOD_INTERFACES 5465532Snectar 5565532Snectar /* Configuration information. */ 5665532Snectar 5765532Snectar#ifndef _PATH_HESIOD_CONF /* Configuration file. */ 5865532Snectar#define _PATH_HESIOD_CONF "/etc/hesiod.conf" 5965532Snectar#endif 6065532Snectar 6165532Snectar#define DEF_RHS "" /* Defaults if HESIOD_CONF */ 6265532Snectar#define DEF_LHS "" /* file is not present. */ 6365532Snectar 6465532Snectar /* Error codes (for backwards compatibility) */ 6565532Snectar 6665532Snectar#define HES_ER_UNINIT -1 /* uninitialized */ 6765532Snectar#define HES_ER_OK 0 /* no error */ 6865532Snectar#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */ 6965532Snectar#define HES_ER_CONFIG 2 /* local problem (no config file?) */ 7065532Snectar#define HES_ER_NET 3 /* network problem */ 7165532Snectar 7265532Snectar /* Declaration of routines */ 7365532Snectar 7465532Snectar#include <sys/cdefs.h> 7565532Snectar 7665532Snectar__BEGIN_DECLS 7793032Simpint hesiod_init(void **); 7893032Simpchar **hesiod_resolve(void *, const char *, const char *); 7993032Simpvoid hesiod_free_list(void *, char **); 8093032Simpchar *hesiod_to_bind(void *, const char *, const char *); 8193032Simpvoid hesiod_end(void *); 8265532Snectar 8365532Snectar /* backwards compatibility */ 8493032Simpint hes_init(void); 8593032Simpchar *hes_to_bind(const char *, const char *); 8693032Simpchar **hes_resolve(const char *, const char *); 8793032Simpint hes_error(void); 8893032Simpvoid hes_free(char **); 8965532Snectar__END_DECLS 9065532Snectar 9165532Snectar#endif /* ! _HESIOD_H_ */ 92