1*ce099b40Smartin /* $NetBSD: hesiod.h,v 1.5 2008/04/28 20:22:54 martin Exp $ */ 2f649503dSlukem 304f41ad3Slukem /*- 404f41ad3Slukem * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. 504f41ad3Slukem * All rights reserved. 6f649503dSlukem * 704f41ad3Slukem * Redistribution and use in source and binary forms, with or without 804f41ad3Slukem * modification, are permitted provided that the following conditions 904f41ad3Slukem * are met: 1004f41ad3Slukem * 1. Redistributions of source code must retain the above copyright 1104f41ad3Slukem * notice, this list of conditions and the following disclaimer. 1204f41ad3Slukem * 2. Redistributions in binary form must reproduce the above copyright 1304f41ad3Slukem * notice, this list of conditions and the following disclaimer in the 1404f41ad3Slukem * documentation and/or other materials provided with the distribution. 15f649503dSlukem * 1604f41ad3Slukem * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1704f41ad3Slukem * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1804f41ad3Slukem * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1904f41ad3Slukem * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2004f41ad3Slukem * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2104f41ad3Slukem * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2204f41ad3Slukem * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2304f41ad3Slukem * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2404f41ad3Slukem * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2504f41ad3Slukem * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2604f41ad3Slukem * POSSIBILITY OF SUCH DAMAGE. 27f649503dSlukem */ 2804f41ad3Slukem 2904f41ad3Slukem /* 3004f41ad3Slukem * Copyright (c) 1996 by Internet Software Consortium. 3104f41ad3Slukem * 3204f41ad3Slukem * Permission to use, copy, modify, and distribute this software for any 3304f41ad3Slukem * purpose with or without fee is hereby granted, provided that the above 3404f41ad3Slukem * copyright notice and this permission notice appear in all copies. 3504f41ad3Slukem * 3604f41ad3Slukem * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS 3704f41ad3Slukem * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 3804f41ad3Slukem * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE 3904f41ad3Slukem * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 4004f41ad3Slukem * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 4104f41ad3Slukem * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 4204f41ad3Slukem * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 4304f41ad3Slukem * SOFTWARE. 4404f41ad3Slukem */ 4504f41ad3Slukem 46f649503dSlukem #ifndef _HESIOD_H_ 47f649503dSlukem #define _HESIOD_H_ 48f649503dSlukem 4904f41ad3Slukem /* Application-visible indication that we have the new interfaces */ 5004f41ad3Slukem 5104f41ad3Slukem #define HESIOD_INTERFACES 5204f41ad3Slukem 53f649503dSlukem /* Configuration information. */ 54f649503dSlukem 55f649503dSlukem #ifndef _PATH_HESIOD_CONF /* Configuration file. */ 56f649503dSlukem #define _PATH_HESIOD_CONF "/etc/hesiod.conf" 57f649503dSlukem #endif 58f649503dSlukem 59f649503dSlukem #define DEF_RHS "" /* Defaults if HESIOD_CONF */ 60f649503dSlukem #define DEF_LHS "" /* file is not present. */ 61f649503dSlukem 6204f41ad3Slukem /* Error codes (for backwards compatibility) */ 63f649503dSlukem 64f649503dSlukem #define HES_ER_UNINIT -1 /* uninitialized */ 65f649503dSlukem #define HES_ER_OK 0 /* no error */ 66f649503dSlukem #define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */ 67f649503dSlukem #define HES_ER_CONFIG 2 /* local problem (no config file?) */ 68f649503dSlukem #define HES_ER_NET 3 /* network problem */ 69f649503dSlukem 70f649503dSlukem /* Declaration of routines */ 7104f41ad3Slukem 72f649503dSlukem #include <sys/cdefs.h> 73f649503dSlukem 74f649503dSlukem __BEGIN_DECLS 7519b7469aSperry int hesiod_init (void **); 7619b7469aSperry char **hesiod_resolve (void *, const char *, const char *); 7719b7469aSperry void hesiod_free_list(void *, char **); 7819b7469aSperry char *hesiod_to_bind (void *, const char *, const char *); 7919b7469aSperry void hesiod_end (void *); 8004f41ad3Slukem 8104f41ad3Slukem /* backwards compatibility */ 8219b7469aSperry int hes_init (void); 8319b7469aSperry char *hes_to_bind (const char *, const char *); 8419b7469aSperry char **hes_resolve (const char *, const char *); 8519b7469aSperry int hes_error (void); 8619b7469aSperry void hes_free (char **); 87f649503dSlukem __END_DECLS 88f649503dSlukem 89f649503dSlukem #endif /* ! _HESIOD_H_ */ 90