xref: /freebsd/lib/libc/net/hesiod.3 (revision 32eef9aeb1f39a1623cea55da147c89abbd5b9a5)
1248aee62SJacques Vidrine.\"	$NetBSD: hesiod.3,v 1.1 1999/01/25 03:43:04 lukem Exp $
2248aee62SJacques Vidrine.\"	$FreeBSD$
3248aee62SJacques Vidrine.\"
4248aee62SJacques Vidrine.\" from: #Id: hesiod.3,v 1.9.2.1 1997/01/03 21:02:23 ghudson Exp #
5248aee62SJacques Vidrine.\"
6248aee62SJacques Vidrine.\" Copyright 1988, 1996 by the Massachusetts Institute of Technology.
7248aee62SJacques Vidrine.\"
8248aee62SJacques Vidrine.\" Permission to use, copy, modify, and distribute this
9248aee62SJacques Vidrine.\" software and its documentation for any purpose and without
10248aee62SJacques Vidrine.\" fee is hereby granted, provided that the above copyright
11248aee62SJacques Vidrine.\" notice appear in all copies and that both that copyright
12248aee62SJacques Vidrine.\" notice and this permission notice appear in supporting
13248aee62SJacques Vidrine.\" documentation, and that the name of M.I.T. not be used in
14248aee62SJacques Vidrine.\" advertising or publicity pertaining to distribution of the
15248aee62SJacques Vidrine.\" software without specific, written prior permission.
16248aee62SJacques Vidrine.\" M.I.T. makes no representations about the suitability of
17248aee62SJacques Vidrine.\" this software for any purpose.  It is provided "as is"
18248aee62SJacques Vidrine.\" without express or implied warranty.
19248aee62SJacques Vidrine.\"
207d17799eSRuslan Ermilov.Dd November 30, 1996
217d17799eSRuslan Ermilov.Dt HESIOD 3
227d17799eSRuslan Ermilov.Os
237d17799eSRuslan Ermilov.Sh NAME
247d17799eSRuslan Ermilov.Nm hesiod ,
257d17799eSRuslan Ermilov.Nm hesiod_init ,
267d17799eSRuslan Ermilov.Nm hesiod_resolve ,
277d17799eSRuslan Ermilov.Nm hesiod_free_list ,
287d17799eSRuslan Ermilov.Nm hesiod_to_bind ,
297d17799eSRuslan Ermilov.Nm hesiod_end
307d17799eSRuslan Ermilov.Nd Hesiod name server interface library
317d17799eSRuslan Ermilov.Sh LIBRARY
327d17799eSRuslan Ermilov.Lb libc
337d17799eSRuslan Ermilov.Sh SYNOPSIS
3432eef9aeSRuslan Ermilov.In hesiod.h
357d17799eSRuslan Ermilov.Ft int
367d17799eSRuslan Ermilov.Fn hesiod_init "void **context"
377d17799eSRuslan Ermilov.Ft char **
387d17799eSRuslan Ermilov.Fn hesiod_resolve "void *context" "const char *name" "const char *type"
397d17799eSRuslan Ermilov.Ft void
407d17799eSRuslan Ermilov.Fn hesiod_free_list "void *context" "char **list"
417d17799eSRuslan Ermilov.Ft char *
427d17799eSRuslan Ermilov.Fn hesiod_to_bind "void *context" "const char *name" "const char *type"
437d17799eSRuslan Ermilov.Ft void
447d17799eSRuslan Ermilov.Fn hesiod_end "void *context"
457d17799eSRuslan Ermilov.Sh DESCRIPTION
46248aee62SJacques VidrineThis family of functions allows you to perform lookups of Hesiod
47248aee62SJacques Vidrineinformation, which is stored as text records in the Domain Name
487d17799eSRuslan ErmilovService.
497d17799eSRuslan ErmilovTo perform lookups, you must first initialize a
507d17799eSRuslan Ermilov.Fa context ,
51248aee62SJacques Vidrinean opaque object which stores information used internally by the
52248aee62SJacques Vidrinelibrary between calls.
537d17799eSRuslan Ermilov.Fn hesiod_init
54248aee62SJacques Vidrineinitializes a context, storing a pointer to the context in the
55248aee62SJacques Vidrinelocation pointed to by the
567d17799eSRuslan Ermilov.Fa context
57248aee62SJacques Vidrineargument.
587d17799eSRuslan Ermilov.Fn hesiod_end
59248aee62SJacques Vidrinefrees the resources used by a context.
607d17799eSRuslan Ermilov.Pp
617d17799eSRuslan Ermilov.Fn hesiod_resolve
627d17799eSRuslan Ermilovis the primary interface to the library.
637d17799eSRuslan ErmilovIf successful, it returns a
64248aee62SJacques Vidrinelist of one or more strings giving the records matching
657d17799eSRuslan Ermilov.Fa name
66248aee62SJacques Vidrineand
677d17799eSRuslan Ermilov.Fa type .
687d17799eSRuslan ErmilovThe last element of the list is followed by a
697d17799eSRuslan Ermilov.Dv NULL
707d17799eSRuslan Ermilovpointer.
717d17799eSRuslan ErmilovIt is the
72248aee62SJacques Vidrinecaller's responsibility to call
737d17799eSRuslan Ermilov.Fn hesiod_free_list
74248aee62SJacques Vidrineto free the resources used by the returned list.
757d17799eSRuslan Ermilov.Pp
767d17799eSRuslan Ermilov.Fn hesiod_to_bind
77248aee62SJacques Vidrineconverts
787d17799eSRuslan Ermilov.Fa name
79248aee62SJacques Vidrineand
807d17799eSRuslan Ermilov.Fa type
81248aee62SJacques Vidrineinto the DNS name used by
827d17799eSRuslan Ermilov.Fn hesiod_resolve .
83248aee62SJacques VidrineIt is the caller's responsibility to free the returned string using
847d17799eSRuslan Ermilov.Fn free .
857d17799eSRuslan Ermilov.Sh RETURN VALUES
867d17799eSRuslan Ermilov.Rv -std hesiod_init
877d17799eSRuslan ErmilovOn failure,
887d17799eSRuslan Ermilov.Fn hesiod_resolve
89248aee62SJacques Vidrineand
907d17799eSRuslan Ermilov.Fn hesiod_to_bind
917d17799eSRuslan Ermilovreturn
927d17799eSRuslan Ermilov.Dv NULL
937d17799eSRuslan Ermilovand set the global variable
947d17799eSRuslan Ermilov.Va errno
95248aee62SJacques Vidrineto indicate the error.
967d17799eSRuslan Ermilov.Sh ENVIRONMENT
977d17799eSRuslan Ermilov.Bl -tag -width HESIOD_CONFIG
987d17799eSRuslan Ermilov.It Ev HES_DOMAIN
99248aee62SJacques VidrineIf the environment variable
1007d17799eSRuslan Ermilov.Ev HES_DOMAIN
101248aee62SJacques Vidrineis set, it will override the domain in the Hesiod configuration file.
1027d17799eSRuslan Ermilov.It Ev HESIOD_CONFIG
103248aee62SJacques VidrineIf the environment variable
1047d17799eSRuslan Ermilov.Ev HESIOD_CONFIG
105248aee62SJacques Vidrineis set, it specifies the location of the Hesiod configuration file.
1067d17799eSRuslan Ermilov.El
1077d17799eSRuslan Ermilov.Sh SEE ALSO
1087d17799eSRuslan Ermilov.Xr hesiod.conf 5 ,
1097d17799eSRuslan Ermilov.Xr named 8
1107d17799eSRuslan Ermilov.Rs
1117d17799eSRuslan Ermilov.%T "Hesiod - Project Athena Technical Plan -- Name Service"
1127d17799eSRuslan Ermilov.Re
1137d17799eSRuslan Ermilov.Sh ERRORS
114248aee62SJacques VidrineHesiod calls may fail because of:
1157d17799eSRuslan Ermilov.Bl -tag -width Er
1167d17799eSRuslan Ermilov.It Bq Er ENOMEM
117248aee62SJacques VidrineInsufficient memory was available to carry out the requested
118248aee62SJacques Vidrineoperation.
1197d17799eSRuslan Ermilov.It Bq Er ENOEXEC
1207d17799eSRuslan Ermilov.Fn hesiod_init
121248aee62SJacques Vidrinefailed because the Hesiod configuration file was invalid.
1227d17799eSRuslan Ermilov.It Bq Er ECONNREFUSED
1237d17799eSRuslan Ermilov.Fn hesiod_resolve
124248aee62SJacques Vidrinefailed because no name server could be contacted to answer the query.
1257d17799eSRuslan Ermilov.It Bq Er EMSGSIZE
1267d17799eSRuslan Ermilov.Fn hesiod_resolve
127248aee62SJacques Vidrineor
1287d17799eSRuslan Ermilov.Fn hesiod_to_bind
129248aee62SJacques Vidrinefailed because the query or response was too big to fit into the
130248aee62SJacques Vidrinepacket buffers.
1317d17799eSRuslan Ermilov.It Bq Er ENOENT
1327d17799eSRuslan Ermilov.Fn hesiod_resolve
133248aee62SJacques Vidrinefailed because the name server had no text records matching
1347d17799eSRuslan Ermilov.Fa name
135248aee62SJacques Vidrineand
1367d17799eSRuslan Ermilov.Fa type ,
137248aee62SJacques Vidrineor
1387d17799eSRuslan Ermilov.Fn hesiod_to_bind
139248aee62SJacques Vidrinefailed because the
1407d17799eSRuslan Ermilov.Fa name
141248aee62SJacques Vidrineargument had a domain extension which could not be resolved with type
1427d17799eSRuslan Ermilov.Dq rhs\-extension
1437d17799eSRuslan Ermilovin the local Hesiod domain.
1447d17799eSRuslan Ermilov.El
1457d17799eSRuslan Ermilov.Sh AUTHORS
1467d17799eSRuslan Ermilov.An Steve Dyer ,
1477d17799eSRuslan ErmilovIBM/Project Athena
1487d17799eSRuslan Ermilov.An Greg Hudson ,
1497d17799eSRuslan ErmilovMIT Team Athena
1507d17799eSRuslan Ermilov.Pp
151248aee62SJacques VidrineCopyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology.
1527d17799eSRuslan Ermilov.Sh BUGS
153248aee62SJacques VidrineThe strings corresponding to the
1547d17799eSRuslan Ermilov.Va errno
155248aee62SJacques Vidrinevalues set by the Hesiod functions are not particularly indicative of
156248aee62SJacques Vidrinewhat went wrong, especially for
1577d17799eSRuslan Ermilov.Er ENOEXEC
158248aee62SJacques Vidrineand
1597d17799eSRuslan Ermilov.Er ENOENT .
160