1248aee62SJacques Vidrine.\" $NetBSD: hesiod.3,v 1.1 1999/01/25 03:43:04 lukem Exp $ 2248aee62SJacques Vidrine.\" 3248aee62SJacques Vidrine.\" from: #Id: hesiod.3,v 1.9.2.1 1997/01/03 21:02:23 ghudson Exp # 4248aee62SJacques Vidrine.\" 5248aee62SJacques Vidrine.\" Copyright 1988, 1996 by the Massachusetts Institute of Technology. 6248aee62SJacques Vidrine.\" 7248aee62SJacques Vidrine.\" Permission to use, copy, modify, and distribute this 8248aee62SJacques Vidrine.\" software and its documentation for any purpose and without 9248aee62SJacques Vidrine.\" fee is hereby granted, provided that the above copyright 10248aee62SJacques Vidrine.\" notice appear in all copies and that both that copyright 11248aee62SJacques Vidrine.\" notice and this permission notice appear in supporting 12248aee62SJacques Vidrine.\" documentation, and that the name of M.I.T. not be used in 13248aee62SJacques Vidrine.\" advertising or publicity pertaining to distribution of the 14248aee62SJacques Vidrine.\" software without specific, written prior permission. 15248aee62SJacques Vidrine.\" M.I.T. makes no representations about the suitability of 16248aee62SJacques Vidrine.\" this software for any purpose. It is provided "as is" 17248aee62SJacques Vidrine.\" without express or implied warranty. 18248aee62SJacques Vidrine.\" 19*4a3c598fSFernando Apesteguía.Dd June 27, 2022 207d17799eSRuslan Ermilov.Dt HESIOD 3 217d17799eSRuslan Ermilov.Os 227d17799eSRuslan Ermilov.Sh NAME 237d17799eSRuslan Ermilov.Nm hesiod , 247d17799eSRuslan Ermilov.Nm hesiod_init , 257d17799eSRuslan Ermilov.Nm hesiod_resolve , 267d17799eSRuslan Ermilov.Nm hesiod_free_list , 277d17799eSRuslan Ermilov.Nm hesiod_to_bind , 287d17799eSRuslan Ermilov.Nm hesiod_end 297d17799eSRuslan Ermilov.Nd Hesiod name server interface library 307d17799eSRuslan Ermilov.Sh LIBRARY 317d17799eSRuslan Ermilov.Lb libc 327d17799eSRuslan Ermilov.Sh SYNOPSIS 3332eef9aeSRuslan Ermilov.In hesiod.h 347d17799eSRuslan Ermilov.Ft int 357d17799eSRuslan Ermilov.Fn hesiod_init "void **context" 367d17799eSRuslan Ermilov.Ft char ** 377d17799eSRuslan Ermilov.Fn hesiod_resolve "void *context" "const char *name" "const char *type" 387d17799eSRuslan Ermilov.Ft void 397d17799eSRuslan Ermilov.Fn hesiod_free_list "void *context" "char **list" 407d17799eSRuslan Ermilov.Ft char * 417d17799eSRuslan Ermilov.Fn hesiod_to_bind "void *context" "const char *name" "const char *type" 427d17799eSRuslan Ermilov.Ft void 437d17799eSRuslan Ermilov.Fn hesiod_end "void *context" 447d17799eSRuslan Ermilov.Sh DESCRIPTION 45248aee62SJacques VidrineThis family of functions allows you to perform lookups of Hesiod 46248aee62SJacques Vidrineinformation, which is stored as text records in the Domain Name 477d17799eSRuslan ErmilovService. 487d17799eSRuslan ErmilovTo perform lookups, you must first initialize a 497d17799eSRuslan Ermilov.Fa context , 50248aee62SJacques Vidrinean opaque object which stores information used internally by the 51248aee62SJacques Vidrinelibrary between calls. 521fae73b1SRuslan ErmilovThe 537d17799eSRuslan Ermilov.Fn hesiod_init 541fae73b1SRuslan Ermilovfunction 55248aee62SJacques Vidrineinitializes a context, storing a pointer to the context in the 56248aee62SJacques Vidrinelocation pointed to by the 577d17799eSRuslan Ermilov.Fa context 58248aee62SJacques Vidrineargument. 591fae73b1SRuslan ErmilovThe 607d17799eSRuslan Ermilov.Fn hesiod_end 611fae73b1SRuslan Ermilovfunction 62248aee62SJacques Vidrinefrees the resources used by a context. 637d17799eSRuslan Ermilov.Pp 641fae73b1SRuslan ErmilovThe 657d17799eSRuslan Ermilov.Fn hesiod_resolve 661fae73b1SRuslan Ermilovfunction 677d17799eSRuslan Ermilovis the primary interface to the library. 687d17799eSRuslan ErmilovIf successful, it returns a 69248aee62SJacques Vidrinelist of one or more strings giving the records matching 707d17799eSRuslan Ermilov.Fa name 71248aee62SJacques Vidrineand 727d17799eSRuslan Ermilov.Fa type . 737d17799eSRuslan ErmilovThe last element of the list is followed by a 747d17799eSRuslan Ermilov.Dv NULL 757d17799eSRuslan Ermilovpointer. 767d17799eSRuslan ErmilovIt is the 77248aee62SJacques Vidrinecaller's responsibility to call 787d17799eSRuslan Ermilov.Fn hesiod_free_list 79248aee62SJacques Vidrineto free the resources used by the returned list. 807d17799eSRuslan Ermilov.Pp 811fae73b1SRuslan ErmilovThe 827d17799eSRuslan Ermilov.Fn hesiod_to_bind 831fae73b1SRuslan Ermilovfunction 84248aee62SJacques Vidrineconverts 857d17799eSRuslan Ermilov.Fa name 86248aee62SJacques Vidrineand 877d17799eSRuslan Ermilov.Fa type 88248aee62SJacques Vidrineinto the DNS name used by 897d17799eSRuslan Ermilov.Fn hesiod_resolve . 90248aee62SJacques VidrineIt is the caller's responsibility to free the returned string using 917d17799eSRuslan Ermilov.Fn free . 927d17799eSRuslan Ermilov.Sh RETURN VALUES 937d17799eSRuslan Ermilov.Rv -std hesiod_init 947d17799eSRuslan ErmilovOn failure, 957d17799eSRuslan Ermilov.Fn hesiod_resolve 96248aee62SJacques Vidrineand 977d17799eSRuslan Ermilov.Fn hesiod_to_bind 987d17799eSRuslan Ermilovreturn 997d17799eSRuslan Ermilov.Dv NULL 1007d17799eSRuslan Ermilovand set the global variable 1017d17799eSRuslan Ermilov.Va errno 102248aee62SJacques Vidrineto indicate the error. 1037d17799eSRuslan Ermilov.Sh ENVIRONMENT 1047d17799eSRuslan Ermilov.Bl -tag -width HESIOD_CONFIG 1057d17799eSRuslan Ermilov.It Ev HES_DOMAIN 106248aee62SJacques VidrineIf the environment variable 1077d17799eSRuslan Ermilov.Ev HES_DOMAIN 108248aee62SJacques Vidrineis set, it will override the domain in the Hesiod configuration file. 1097d17799eSRuslan Ermilov.It Ev HESIOD_CONFIG 110248aee62SJacques VidrineIf the environment variable 1117d17799eSRuslan Ermilov.Ev HESIOD_CONFIG 112248aee62SJacques Vidrineis set, it specifies the location of the Hesiod configuration file. 1137d17799eSRuslan Ermilov.El 1147d17799eSRuslan Ermilov.Sh ERRORS 115248aee62SJacques VidrineHesiod calls may fail because of: 1167d17799eSRuslan Ermilov.Bl -tag -width Er 1177d17799eSRuslan Ermilov.It Bq Er ENOMEM 118248aee62SJacques VidrineInsufficient memory was available to carry out the requested 119248aee62SJacques Vidrineoperation. 1207d17799eSRuslan Ermilov.It Bq Er ENOEXEC 1211fae73b1SRuslan ErmilovThe 1227d17799eSRuslan Ermilov.Fn hesiod_init 1231fae73b1SRuslan Ermilovfunction 124248aee62SJacques Vidrinefailed because the Hesiod configuration file was invalid. 1257d17799eSRuslan Ermilov.It Bq Er ECONNREFUSED 1261fae73b1SRuslan ErmilovThe 1277d17799eSRuslan Ermilov.Fn hesiod_resolve 1281fae73b1SRuslan Ermilovfunction 129248aee62SJacques Vidrinefailed because no name server could be contacted to answer the query. 1307d17799eSRuslan Ermilov.It Bq Er EMSGSIZE 1311fae73b1SRuslan ErmilovThe 1327d17799eSRuslan Ermilov.Fn hesiod_resolve 133248aee62SJacques Vidrineor 1347d17799eSRuslan Ermilov.Fn hesiod_to_bind 1351fae73b1SRuslan Ermilovfunction 136248aee62SJacques Vidrinefailed because the query or response was too big to fit into the 137248aee62SJacques Vidrinepacket buffers. 1387d17799eSRuslan Ermilov.It Bq Er ENOENT 1391fae73b1SRuslan ErmilovThe 1407d17799eSRuslan Ermilov.Fn hesiod_resolve 1411fae73b1SRuslan Ermilovfunction 142248aee62SJacques Vidrinefailed because the name server had no text records matching 1437d17799eSRuslan Ermilov.Fa name 144248aee62SJacques Vidrineand 1457d17799eSRuslan Ermilov.Fa type , 146248aee62SJacques Vidrineor 1477d17799eSRuslan Ermilov.Fn hesiod_to_bind 148248aee62SJacques Vidrinefailed because the 1497d17799eSRuslan Ermilov.Fa name 150248aee62SJacques Vidrineargument had a domain extension which could not be resolved with type 1517d17799eSRuslan Ermilov.Dq rhs\-extension 1527d17799eSRuslan Ermilovin the local Hesiod domain. 1537d17799eSRuslan Ermilov.El 15424a0682cSRuslan Ermilov.Sh SEE ALSO 155942e234dSFernando Apesteguía.Xr hesiod.conf 5 15624a0682cSRuslan Ermilov.Rs 15724a0682cSRuslan Ermilov.%T "Hesiod - Project Athena Technical Plan -- Name Service" 15824a0682cSRuslan Ermilov.Re 1597d17799eSRuslan Ermilov.Sh AUTHORS 1607d17799eSRuslan Ermilov.An Steve Dyer , 1617d17799eSRuslan ErmilovIBM/Project Athena 1627d17799eSRuslan Ermilov.An Greg Hudson , 1637d17799eSRuslan ErmilovMIT Team Athena 1647d17799eSRuslan Ermilov.Pp 165248aee62SJacques VidrineCopyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology. 1667d17799eSRuslan Ermilov.Sh BUGS 167248aee62SJacques VidrineThe strings corresponding to the 1687d17799eSRuslan Ermilov.Va errno 169248aee62SJacques Vidrinevalues set by the Hesiod functions are not particularly indicative of 170248aee62SJacques Vidrinewhat went wrong, especially for 1717d17799eSRuslan Ermilov.Er ENOEXEC 172248aee62SJacques Vidrineand 1737d17799eSRuslan Ermilov.Er ENOENT . 174