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.\" 191fae73b1SRuslan Ermilov.\" $FreeBSD$ 201fae73b1SRuslan Ermilov.\" 217d17799eSRuslan Ermilov.Dd November 30, 1996 227d17799eSRuslan Ermilov.Dt HESIOD 3 237d17799eSRuslan Ermilov.Os 247d17799eSRuslan Ermilov.Sh NAME 257d17799eSRuslan Ermilov.Nm hesiod , 267d17799eSRuslan Ermilov.Nm hesiod_init , 277d17799eSRuslan Ermilov.Nm hesiod_resolve , 287d17799eSRuslan Ermilov.Nm hesiod_free_list , 297d17799eSRuslan Ermilov.Nm hesiod_to_bind , 307d17799eSRuslan Ermilov.Nm hesiod_end 317d17799eSRuslan Ermilov.Nd Hesiod name server interface library 327d17799eSRuslan Ermilov.Sh LIBRARY 337d17799eSRuslan Ermilov.Lb libc 347d17799eSRuslan Ermilov.Sh SYNOPSIS 3532eef9aeSRuslan Ermilov.In hesiod.h 367d17799eSRuslan Ermilov.Ft int 377d17799eSRuslan Ermilov.Fn hesiod_init "void **context" 387d17799eSRuslan Ermilov.Ft char ** 397d17799eSRuslan Ermilov.Fn hesiod_resolve "void *context" "const char *name" "const char *type" 407d17799eSRuslan Ermilov.Ft void 417d17799eSRuslan Ermilov.Fn hesiod_free_list "void *context" "char **list" 427d17799eSRuslan Ermilov.Ft char * 437d17799eSRuslan Ermilov.Fn hesiod_to_bind "void *context" "const char *name" "const char *type" 447d17799eSRuslan Ermilov.Ft void 457d17799eSRuslan Ermilov.Fn hesiod_end "void *context" 467d17799eSRuslan Ermilov.Sh DESCRIPTION 47248aee62SJacques VidrineThis family of functions allows you to perform lookups of Hesiod 48248aee62SJacques Vidrineinformation, which is stored as text records in the Domain Name 497d17799eSRuslan ErmilovService. 507d17799eSRuslan ErmilovTo perform lookups, you must first initialize a 517d17799eSRuslan Ermilov.Fa context , 52248aee62SJacques Vidrinean opaque object which stores information used internally by the 53248aee62SJacques Vidrinelibrary between calls. 541fae73b1SRuslan ErmilovThe 557d17799eSRuslan Ermilov.Fn hesiod_init 561fae73b1SRuslan Ermilovfunction 57248aee62SJacques Vidrineinitializes a context, storing a pointer to the context in the 58248aee62SJacques Vidrinelocation pointed to by the 597d17799eSRuslan Ermilov.Fa context 60248aee62SJacques Vidrineargument. 611fae73b1SRuslan ErmilovThe 627d17799eSRuslan Ermilov.Fn hesiod_end 631fae73b1SRuslan Ermilovfunction 64248aee62SJacques Vidrinefrees the resources used by a context. 657d17799eSRuslan Ermilov.Pp 661fae73b1SRuslan ErmilovThe 677d17799eSRuslan Ermilov.Fn hesiod_resolve 681fae73b1SRuslan Ermilovfunction 697d17799eSRuslan Ermilovis the primary interface to the library. 707d17799eSRuslan ErmilovIf successful, it returns a 71248aee62SJacques Vidrinelist of one or more strings giving the records matching 727d17799eSRuslan Ermilov.Fa name 73248aee62SJacques Vidrineand 747d17799eSRuslan Ermilov.Fa type . 757d17799eSRuslan ErmilovThe last element of the list is followed by a 767d17799eSRuslan Ermilov.Dv NULL 777d17799eSRuslan Ermilovpointer. 787d17799eSRuslan ErmilovIt is the 79248aee62SJacques Vidrinecaller's responsibility to call 807d17799eSRuslan Ermilov.Fn hesiod_free_list 81248aee62SJacques Vidrineto free the resources used by the returned list. 827d17799eSRuslan Ermilov.Pp 831fae73b1SRuslan ErmilovThe 847d17799eSRuslan Ermilov.Fn hesiod_to_bind 851fae73b1SRuslan Ermilovfunction 86248aee62SJacques Vidrineconverts 877d17799eSRuslan Ermilov.Fa name 88248aee62SJacques Vidrineand 897d17799eSRuslan Ermilov.Fa type 90248aee62SJacques Vidrineinto the DNS name used by 917d17799eSRuslan Ermilov.Fn hesiod_resolve . 92248aee62SJacques VidrineIt is the caller's responsibility to free the returned string using 937d17799eSRuslan Ermilov.Fn free . 947d17799eSRuslan Ermilov.Sh RETURN VALUES 957d17799eSRuslan Ermilov.Rv -std hesiod_init 967d17799eSRuslan ErmilovOn failure, 977d17799eSRuslan Ermilov.Fn hesiod_resolve 98248aee62SJacques Vidrineand 997d17799eSRuslan Ermilov.Fn hesiod_to_bind 1007d17799eSRuslan Ermilovreturn 1017d17799eSRuslan Ermilov.Dv NULL 1027d17799eSRuslan Ermilovand set the global variable 1037d17799eSRuslan Ermilov.Va errno 104248aee62SJacques Vidrineto indicate the error. 1057d17799eSRuslan Ermilov.Sh ENVIRONMENT 1067d17799eSRuslan Ermilov.Bl -tag -width HESIOD_CONFIG 1077d17799eSRuslan Ermilov.It Ev HES_DOMAIN 108248aee62SJacques VidrineIf the environment variable 1097d17799eSRuslan Ermilov.Ev HES_DOMAIN 110248aee62SJacques Vidrineis set, it will override the domain in the Hesiod configuration file. 1117d17799eSRuslan Ermilov.It Ev HESIOD_CONFIG 112248aee62SJacques VidrineIf the environment variable 1137d17799eSRuslan Ermilov.Ev HESIOD_CONFIG 114248aee62SJacques Vidrineis set, it specifies the location of the Hesiod configuration file. 1157d17799eSRuslan Ermilov.El 1167d17799eSRuslan Ermilov.Sh ERRORS 117248aee62SJacques VidrineHesiod calls may fail because of: 1187d17799eSRuslan Ermilov.Bl -tag -width Er 1197d17799eSRuslan Ermilov.It Bq Er ENOMEM 120248aee62SJacques VidrineInsufficient memory was available to carry out the requested 121248aee62SJacques Vidrineoperation. 1227d17799eSRuslan Ermilov.It Bq Er ENOEXEC 1231fae73b1SRuslan ErmilovThe 1247d17799eSRuslan Ermilov.Fn hesiod_init 1251fae73b1SRuslan Ermilovfunction 126248aee62SJacques Vidrinefailed because the Hesiod configuration file was invalid. 1277d17799eSRuslan Ermilov.It Bq Er ECONNREFUSED 1281fae73b1SRuslan ErmilovThe 1297d17799eSRuslan Ermilov.Fn hesiod_resolve 1301fae73b1SRuslan Ermilovfunction 131248aee62SJacques Vidrinefailed because no name server could be contacted to answer the query. 1327d17799eSRuslan Ermilov.It Bq Er EMSGSIZE 1331fae73b1SRuslan ErmilovThe 1347d17799eSRuslan Ermilov.Fn hesiod_resolve 135248aee62SJacques Vidrineor 1367d17799eSRuslan Ermilov.Fn hesiod_to_bind 1371fae73b1SRuslan Ermilovfunction 138248aee62SJacques Vidrinefailed because the query or response was too big to fit into the 139248aee62SJacques Vidrinepacket buffers. 1407d17799eSRuslan Ermilov.It Bq Er ENOENT 1411fae73b1SRuslan ErmilovThe 1427d17799eSRuslan Ermilov.Fn hesiod_resolve 1431fae73b1SRuslan Ermilovfunction 144248aee62SJacques Vidrinefailed because the name server had no text records matching 1457d17799eSRuslan Ermilov.Fa name 146248aee62SJacques Vidrineand 1477d17799eSRuslan Ermilov.Fa type , 148248aee62SJacques Vidrineor 1497d17799eSRuslan Ermilov.Fn hesiod_to_bind 150248aee62SJacques Vidrinefailed because the 1517d17799eSRuslan Ermilov.Fa name 152248aee62SJacques Vidrineargument had a domain extension which could not be resolved with type 1537d17799eSRuslan Ermilov.Dq rhs\-extension 1547d17799eSRuslan Ermilovin the local Hesiod domain. 1557d17799eSRuslan Ermilov.El 15624a0682cSRuslan Ermilov.Sh SEE ALSO 15724a0682cSRuslan Ermilov.Xr hesiod.conf 5 , 15824a0682cSRuslan Ermilov.Xr named 8 15924a0682cSRuslan Ermilov.Rs 16024a0682cSRuslan Ermilov.%T "Hesiod - Project Athena Technical Plan -- Name Service" 16124a0682cSRuslan Ermilov.Re 1627d17799eSRuslan Ermilov.Sh AUTHORS 1637d17799eSRuslan Ermilov.An Steve Dyer , 1647d17799eSRuslan ErmilovIBM/Project Athena 1657d17799eSRuslan Ermilov.An Greg Hudson , 1667d17799eSRuslan ErmilovMIT Team Athena 1677d17799eSRuslan Ermilov.Pp 168248aee62SJacques VidrineCopyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology. 1697d17799eSRuslan Ermilov.Sh BUGS 170248aee62SJacques VidrineThe strings corresponding to the 1717d17799eSRuslan Ermilov.Va errno 172248aee62SJacques Vidrinevalues set by the Hesiod functions are not particularly indicative of 173248aee62SJacques Vidrinewhat went wrong, especially for 1747d17799eSRuslan Ermilov.Er ENOEXEC 175248aee62SJacques Vidrineand 1767d17799eSRuslan Ermilov.Er ENOENT . 177