1*2fe8fb19SBen Gras.\" $NetBSD: hesiod.3,v 1.7 2009/03/10 23:36:10 joerg Exp $ 2*2fe8fb19SBen Gras.\" 3*2fe8fb19SBen Gras.\" from: #Id: hesiod.3,v 1.9.2.1 1997/01/03 21:02:23 ghudson Exp # 4*2fe8fb19SBen Gras.\" 5*2fe8fb19SBen Gras.\" Copyright 1988, 1996 by the Massachusetts Institute of Technology. 6*2fe8fb19SBen Gras.\" 7*2fe8fb19SBen Gras.\" Permission to use, copy, modify, and distribute this 8*2fe8fb19SBen Gras.\" software and its documentation for any purpose and without 9*2fe8fb19SBen Gras.\" fee is hereby granted, provided that the above copyright 10*2fe8fb19SBen Gras.\" notice appear in all copies and that both that copyright 11*2fe8fb19SBen Gras.\" notice and this permission notice appear in supporting 12*2fe8fb19SBen Gras.\" documentation, and that the name of M.I.T. not be used in 13*2fe8fb19SBen Gras.\" advertising or publicity pertaining to distribution of the 14*2fe8fb19SBen Gras.\" software without specific, written prior permission. 15*2fe8fb19SBen Gras.\" M.I.T. makes no representations about the suitability of 16*2fe8fb19SBen Gras.\" this software for any purpose. It is provided "as is" 17*2fe8fb19SBen Gras.\" without express or implied warranty. 18*2fe8fb19SBen Gras.\" 19*2fe8fb19SBen Gras.Dd September 16, 2001 20*2fe8fb19SBen Gras.Dt HESIOD 3 21*2fe8fb19SBen Gras.Os 22*2fe8fb19SBen Gras.Sh NAME 23*2fe8fb19SBen Gras.Nm hesiod , 24*2fe8fb19SBen Gras.Nm hesiod_init , 25*2fe8fb19SBen Gras.Nm hesiod_resolve , 26*2fe8fb19SBen Gras.Nm hesiod_free_list , 27*2fe8fb19SBen Gras.Nm hesiod_to_bind , 28*2fe8fb19SBen Gras.Nm hesiod_end 29*2fe8fb19SBen Gras.Nd Hesiod name server interface library 30*2fe8fb19SBen Gras.Sh LIBRARY 31*2fe8fb19SBen Gras.Lb libc 32*2fe8fb19SBen Gras.Sh SYNOPSIS 33*2fe8fb19SBen Gras.In hesiod.h 34*2fe8fb19SBen Gras.Ft int 35*2fe8fb19SBen Gras.Fn hesiod_init "void **context" 36*2fe8fb19SBen Gras.Ft char 37*2fe8fb19SBen Gras.Fn **hesiod_resolve "void *context" "const char *name" "const char *type" 38*2fe8fb19SBen Gras.Ft void 39*2fe8fb19SBen Gras.Fn hesiod_free_list "void *context" "char **list" 40*2fe8fb19SBen Gras.Ft char 41*2fe8fb19SBen Gras.Fn *hesiod_to_bind "void *context" "const char *name" "const char *type" 42*2fe8fb19SBen Gras.Ft void 43*2fe8fb19SBen Gras.Fn hesiod_end "void *context" 44*2fe8fb19SBen Gras.Sh DESCRIPTION 45*2fe8fb19SBen GrasThis family of functions allows you to perform lookups of Hesiod 46*2fe8fb19SBen Grasinformation, which is stored as text records in the Domain Name 47*2fe8fb19SBen GrasService. To perform lookups, you must first initialize a 48*2fe8fb19SBen Gras.Fa context , 49*2fe8fb19SBen Grasan opaque object which stores information used internally by the 50*2fe8fb19SBen Graslibrary between calls. 51*2fe8fb19SBen Gras.Fn hesiod_init 52*2fe8fb19SBen Grasinitializes a context, storing a pointer to the context in the 53*2fe8fb19SBen Graslocation pointed to by the 54*2fe8fb19SBen Gras.Fa context 55*2fe8fb19SBen Grasargument. 56*2fe8fb19SBen Gras.Fn hesiod_end 57*2fe8fb19SBen Grasfrees the resources used by a context. 58*2fe8fb19SBen Gras.Pp 59*2fe8fb19SBen Gras.Fn hesiod_resolve 60*2fe8fb19SBen Grasis the primary interface to the library. If successful, it returns a 61*2fe8fb19SBen Graslist of one or more strings giving the records matching 62*2fe8fb19SBen Gras.Fa name 63*2fe8fb19SBen Grasand 64*2fe8fb19SBen Gras.Fa type . 65*2fe8fb19SBen GrasThe last element of the list is followed by a 66*2fe8fb19SBen Gras.Dv NULL 67*2fe8fb19SBen Graspointer. It is the caller's responsibility to call 68*2fe8fb19SBen Gras.Fn hesiod_free_list 69*2fe8fb19SBen Grasto free the resources used by the returned list. 70*2fe8fb19SBen Gras.Pp 71*2fe8fb19SBen Gras.Fn hesiod_to_bind 72*2fe8fb19SBen Grasconverts 73*2fe8fb19SBen Gras.Fa name 74*2fe8fb19SBen Grasand 75*2fe8fb19SBen Gras.Fa type 76*2fe8fb19SBen Grasinto the DNS name used by 77*2fe8fb19SBen Gras.Fn hesiod_resolve . 78*2fe8fb19SBen GrasIt is the caller's responsibility to free the returned string using 79*2fe8fb19SBen Gras.Xr free 3 . 80*2fe8fb19SBen Gras.Sh RETURN VALUES 81*2fe8fb19SBen GrasIf successful, 82*2fe8fb19SBen Gras.Fn hesiod_init 83*2fe8fb19SBen Grasreturns 0; otherwise it returns \-1 and sets 84*2fe8fb19SBen Gras.Va errno 85*2fe8fb19SBen Grasto indicate the error. On failure, 86*2fe8fb19SBen Gras.Fn hesiod_resolve 87*2fe8fb19SBen Grasand 88*2fe8fb19SBen Gras.Fn hesiod_to_bind 89*2fe8fb19SBen Grasreturn 90*2fe8fb19SBen Gras.Dv NULL 91*2fe8fb19SBen Grasand set the global variable 92*2fe8fb19SBen Gras.Va errno 93*2fe8fb19SBen Grasto indicate the error. 94*2fe8fb19SBen Gras.Sh ENVIRONMENT 95*2fe8fb19SBen GrasIf the environment variable 96*2fe8fb19SBen Gras.Ev HES_DOMAIN 97*2fe8fb19SBen Grasis set, it will override the domain in the Hesiod configuration file. 98*2fe8fb19SBen GrasIf the environment variable 99*2fe8fb19SBen Gras.Ev HESIOD_CONFIG 100*2fe8fb19SBen Grasis set, it specifies the location of the Hesiod configuration file. 101*2fe8fb19SBen Gras.Sh ERRORS 102*2fe8fb19SBen GrasHesiod calls may fail because of: 103*2fe8fb19SBen Gras.Bl -tag -width ECONNREFUSED -compact 104*2fe8fb19SBen Gras.It Er ENOMEM 105*2fe8fb19SBen GrasInsufficient memory was available to carry out the requested operation. 106*2fe8fb19SBen Gras.It Er ENOEXEC 107*2fe8fb19SBen Gras.Fn hesiod_init 108*2fe8fb19SBen Grasfailed because the Hesiod configuration file was invalid. 109*2fe8fb19SBen Gras.It Er ECONNREFUSED 110*2fe8fb19SBen Gras.Fn hesiod_resolve 111*2fe8fb19SBen Grasfailed because no name server could be contacted to answer the query. 112*2fe8fb19SBen Gras.It Er EMSGSIZE 113*2fe8fb19SBen Gras.Fn hesiod_resolve 114*2fe8fb19SBen Grasor 115*2fe8fb19SBen Gras.Fn hesiod_to_bind 116*2fe8fb19SBen Grasfailed because the query or response was too big to fit into the 117*2fe8fb19SBen Graspacket buffers. 118*2fe8fb19SBen Gras.It Er ENOENT 119*2fe8fb19SBen Gras.Fn hesiod_resolve 120*2fe8fb19SBen Grasfailed because the name server had no text records matching 121*2fe8fb19SBen Gras.Fa name 122*2fe8fb19SBen Grasand 123*2fe8fb19SBen Gras.Fa type , 124*2fe8fb19SBen Grasor 125*2fe8fb19SBen Gras.Fn hesiod_to_bind 126*2fe8fb19SBen Grasfailed because the 127*2fe8fb19SBen Gras.Fa name 128*2fe8fb19SBen Grasargument had a domain extension which could not be resolved with type 129*2fe8fb19SBen Gras.Dq rhs-extension 130*2fe8fb19SBen Grasin the local Hesiod domain. 131*2fe8fb19SBen Gras.El 132*2fe8fb19SBen Gras.Sh SEE ALSO 133*2fe8fb19SBen Gras.Xr hesiod.conf 5 , 134*2fe8fb19SBen Gras.Xr named 8 135*2fe8fb19SBen Gras.Rs 136*2fe8fb19SBen Gras.%T Hesiod - Project Athena Technical Plan -- Name Service 137*2fe8fb19SBen Gras.Re 138*2fe8fb19SBen Gras.Sh AUTHORS 139*2fe8fb19SBen Gras.An Steve Dyer, IBM/Project Athena 140*2fe8fb19SBen Gras.An Greg Hudson, MIT Team Athena 141*2fe8fb19SBen Gras.Pp 142*2fe8fb19SBen GrasCopyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology. 143*2fe8fb19SBen Gras.Sh BUGS 144*2fe8fb19SBen GrasThe strings corresponding to the 145*2fe8fb19SBen Gras.Ev errno 146*2fe8fb19SBen Grasvalues set by the Hesiod functions are not particularly indicative of 147*2fe8fb19SBen Graswhat went wrong, especially for 148*2fe8fb19SBen Gras.Er ENOEXEC 149*2fe8fb19SBen Grasand 150*2fe8fb19SBen Gras.Er ENOENT . 151