1*86d7f5d3SJohn Marino.\" $NetBSD: hesiod.3,v 1.1 1999/01/25 03:43:04 lukem Exp $ 2*86d7f5d3SJohn Marino.\" 3*86d7f5d3SJohn Marino.\" from: #Id: hesiod.3,v 1.9.2.1 1997/01/03 21:02:23 ghudson Exp # 4*86d7f5d3SJohn Marino.\" 5*86d7f5d3SJohn Marino.\" Copyright 1988, 1996 by the Massachusetts Institute of Technology. 6*86d7f5d3SJohn Marino.\" 7*86d7f5d3SJohn Marino.\" Permission to use, copy, modify, and distribute this 8*86d7f5d3SJohn Marino.\" software and its documentation for any purpose and without 9*86d7f5d3SJohn Marino.\" fee is hereby granted, provided that the above copyright 10*86d7f5d3SJohn Marino.\" notice appear in all copies and that both that copyright 11*86d7f5d3SJohn Marino.\" notice and this permission notice appear in supporting 12*86d7f5d3SJohn Marino.\" documentation, and that the name of M.I.T. not be used in 13*86d7f5d3SJohn Marino.\" advertising or publicity pertaining to distribution of the 14*86d7f5d3SJohn Marino.\" software without specific, written prior permission. 15*86d7f5d3SJohn Marino.\" M.I.T. makes no representations about the suitability of 16*86d7f5d3SJohn Marino.\" this software for any purpose. It is provided "as is" 17*86d7f5d3SJohn Marino.\" without express or implied warranty. 18*86d7f5d3SJohn Marino.\" 19*86d7f5d3SJohn Marino.\" $FreeBSD: src/lib/libc/net/hesiod.3,v 1.5 2005/01/20 09:17:03 ru Exp $ 20*86d7f5d3SJohn Marino.\" 21*86d7f5d3SJohn Marino.Dd November 30, 1996 22*86d7f5d3SJohn Marino.Dt HESIOD 3 23*86d7f5d3SJohn Marino.Os 24*86d7f5d3SJohn Marino.Sh NAME 25*86d7f5d3SJohn Marino.Nm hesiod , 26*86d7f5d3SJohn Marino.Nm hesiod_init , 27*86d7f5d3SJohn Marino.Nm hesiod_resolve , 28*86d7f5d3SJohn Marino.Nm hesiod_free_list , 29*86d7f5d3SJohn Marino.Nm hesiod_to_bind , 30*86d7f5d3SJohn Marino.Nm hesiod_end 31*86d7f5d3SJohn Marino.Nd Hesiod name server interface library 32*86d7f5d3SJohn Marino.Sh LIBRARY 33*86d7f5d3SJohn Marino.Lb libc 34*86d7f5d3SJohn Marino.Sh SYNOPSIS 35*86d7f5d3SJohn Marino.In hesiod.h 36*86d7f5d3SJohn Marino.Ft int 37*86d7f5d3SJohn Marino.Fn hesiod_init "void **context" 38*86d7f5d3SJohn Marino.Ft char ** 39*86d7f5d3SJohn Marino.Fn hesiod_resolve "void *context" "const char *name" "const char *type" 40*86d7f5d3SJohn Marino.Ft void 41*86d7f5d3SJohn Marino.Fn hesiod_free_list "void *context" "char **list" 42*86d7f5d3SJohn Marino.Ft char * 43*86d7f5d3SJohn Marino.Fn hesiod_to_bind "void *context" "const char *name" "const char *type" 44*86d7f5d3SJohn Marino.Ft void 45*86d7f5d3SJohn Marino.Fn hesiod_end "void *context" 46*86d7f5d3SJohn Marino.Sh DESCRIPTION 47*86d7f5d3SJohn MarinoThis family of functions allows you to perform lookups of Hesiod 48*86d7f5d3SJohn Marinoinformation, which is stored as text records in the Domain Name 49*86d7f5d3SJohn MarinoService. 50*86d7f5d3SJohn MarinoTo perform lookups, you must first initialize a 51*86d7f5d3SJohn Marino.Fa context , 52*86d7f5d3SJohn Marinoan opaque object which stores information used internally by the 53*86d7f5d3SJohn Marinolibrary between calls. 54*86d7f5d3SJohn MarinoThe 55*86d7f5d3SJohn Marino.Fn hesiod_init 56*86d7f5d3SJohn Marinofunction 57*86d7f5d3SJohn Marinoinitializes a context, storing a pointer to the context in the 58*86d7f5d3SJohn Marinolocation pointed to by the 59*86d7f5d3SJohn Marino.Fa context 60*86d7f5d3SJohn Marinoargument. 61*86d7f5d3SJohn MarinoThe 62*86d7f5d3SJohn Marino.Fn hesiod_end 63*86d7f5d3SJohn Marinofunction 64*86d7f5d3SJohn Marinofrees the resources used by a context. 65*86d7f5d3SJohn Marino.Pp 66*86d7f5d3SJohn MarinoThe 67*86d7f5d3SJohn Marino.Fn hesiod_resolve 68*86d7f5d3SJohn Marinofunction 69*86d7f5d3SJohn Marinois the primary interface to the library. 70*86d7f5d3SJohn MarinoIf successful, it returns a 71*86d7f5d3SJohn Marinolist of one or more strings giving the records matching 72*86d7f5d3SJohn Marino.Fa name 73*86d7f5d3SJohn Marinoand 74*86d7f5d3SJohn Marino.Fa type . 75*86d7f5d3SJohn MarinoThe last element of the list is followed by a 76*86d7f5d3SJohn Marino.Dv NULL 77*86d7f5d3SJohn Marinopointer. 78*86d7f5d3SJohn MarinoIt is the 79*86d7f5d3SJohn Marinocaller's responsibility to call 80*86d7f5d3SJohn Marino.Fn hesiod_free_list 81*86d7f5d3SJohn Marinoto free the resources used by the returned list. 82*86d7f5d3SJohn Marino.Pp 83*86d7f5d3SJohn MarinoThe 84*86d7f5d3SJohn Marino.Fn hesiod_to_bind 85*86d7f5d3SJohn Marinofunction 86*86d7f5d3SJohn Marinoconverts 87*86d7f5d3SJohn Marino.Fa name 88*86d7f5d3SJohn Marinoand 89*86d7f5d3SJohn Marino.Fa type 90*86d7f5d3SJohn Marinointo the DNS name used by 91*86d7f5d3SJohn Marino.Fn hesiod_resolve . 92*86d7f5d3SJohn MarinoIt is the caller's responsibility to free the returned string using 93*86d7f5d3SJohn Marino.Fn free . 94*86d7f5d3SJohn Marino.Sh RETURN VALUES 95*86d7f5d3SJohn Marino.Rv -std hesiod_init 96*86d7f5d3SJohn MarinoOn failure, 97*86d7f5d3SJohn Marino.Fn hesiod_resolve 98*86d7f5d3SJohn Marinoand 99*86d7f5d3SJohn Marino.Fn hesiod_to_bind 100*86d7f5d3SJohn Marinoreturn 101*86d7f5d3SJohn Marino.Dv NULL 102*86d7f5d3SJohn Marinoand set the global variable 103*86d7f5d3SJohn Marino.Va errno 104*86d7f5d3SJohn Marinoto indicate the error. 105*86d7f5d3SJohn Marino.Sh ENVIRONMENT 106*86d7f5d3SJohn Marino.Bl -tag -width HESIOD_CONFIG 107*86d7f5d3SJohn Marino.It Ev HES_DOMAIN 108*86d7f5d3SJohn MarinoIf the environment variable 109*86d7f5d3SJohn Marino.Ev HES_DOMAIN 110*86d7f5d3SJohn Marinois set, it will override the domain in the Hesiod configuration file. 111*86d7f5d3SJohn Marino.It Ev HESIOD_CONFIG 112*86d7f5d3SJohn MarinoIf the environment variable 113*86d7f5d3SJohn Marino.Ev HESIOD_CONFIG 114*86d7f5d3SJohn Marinois set, it specifies the location of the Hesiod configuration file. 115*86d7f5d3SJohn Marino.El 116*86d7f5d3SJohn Marino.Sh ERRORS 117*86d7f5d3SJohn MarinoHesiod calls may fail because of: 118*86d7f5d3SJohn Marino.Bl -tag -width Er 119*86d7f5d3SJohn Marino.It Bq Er ENOMEM 120*86d7f5d3SJohn MarinoInsufficient memory was available to carry out the requested 121*86d7f5d3SJohn Marinooperation. 122*86d7f5d3SJohn Marino.It Bq Er ENOEXEC 123*86d7f5d3SJohn MarinoThe 124*86d7f5d3SJohn Marino.Fn hesiod_init 125*86d7f5d3SJohn Marinofunction 126*86d7f5d3SJohn Marinofailed because the Hesiod configuration file was invalid. 127*86d7f5d3SJohn Marino.It Bq Er ECONNREFUSED 128*86d7f5d3SJohn MarinoThe 129*86d7f5d3SJohn Marino.Fn hesiod_resolve 130*86d7f5d3SJohn Marinofunction 131*86d7f5d3SJohn Marinofailed because no name server could be contacted to answer the query. 132*86d7f5d3SJohn Marino.It Bq Er EMSGSIZE 133*86d7f5d3SJohn MarinoThe 134*86d7f5d3SJohn Marino.Fn hesiod_resolve 135*86d7f5d3SJohn Marinoor 136*86d7f5d3SJohn Marino.Fn hesiod_to_bind 137*86d7f5d3SJohn Marinofunction 138*86d7f5d3SJohn Marinofailed because the query or response was too big to fit into the 139*86d7f5d3SJohn Marinopacket buffers. 140*86d7f5d3SJohn Marino.It Bq Er ENOENT 141*86d7f5d3SJohn MarinoThe 142*86d7f5d3SJohn Marino.Fn hesiod_resolve 143*86d7f5d3SJohn Marinofunction 144*86d7f5d3SJohn Marinofailed because the name server had no text records matching 145*86d7f5d3SJohn Marino.Fa name 146*86d7f5d3SJohn Marinoand 147*86d7f5d3SJohn Marino.Fa type , 148*86d7f5d3SJohn Marinoor 149*86d7f5d3SJohn Marino.Fn hesiod_to_bind 150*86d7f5d3SJohn Marinofailed because the 151*86d7f5d3SJohn Marino.Fa name 152*86d7f5d3SJohn Marinoargument had a domain extension which could not be resolved with type 153*86d7f5d3SJohn Marino.Dq rhs\-extension 154*86d7f5d3SJohn Marinoin the local Hesiod domain. 155*86d7f5d3SJohn Marino.El 156*86d7f5d3SJohn Marino.Sh SEE ALSO 157*86d7f5d3SJohn Marino.Xr hesiod.conf 5 , 158*86d7f5d3SJohn Marino.Xr named 8 159*86d7f5d3SJohn Marino.Rs 160*86d7f5d3SJohn Marino.%T "Hesiod - Project Athena Technical Plan -- Name Service" 161*86d7f5d3SJohn Marino.Re 162*86d7f5d3SJohn Marino.Sh AUTHORS 163*86d7f5d3SJohn Marino.An Steve Dyer , 164*86d7f5d3SJohn MarinoIBM/Project Athena 165*86d7f5d3SJohn Marino.An Greg Hudson , 166*86d7f5d3SJohn MarinoMIT Team Athena 167*86d7f5d3SJohn Marino.Pp 168*86d7f5d3SJohn MarinoCopyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology. 169*86d7f5d3SJohn Marino.Sh BUGS 170*86d7f5d3SJohn MarinoThe strings corresponding to the 171*86d7f5d3SJohn Marino.Va errno 172*86d7f5d3SJohn Marinovalues set by the Hesiod functions are not particularly indicative of 173*86d7f5d3SJohn Marinowhat went wrong, especially for 174*86d7f5d3SJohn Marino.Er ENOEXEC 175*86d7f5d3SJohn Marinoand 176*86d7f5d3SJohn Marino.Er ENOENT . 177