xref: /freebsd/lib/libc/net/hesiod.3 (revision 1fae73b1)
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 SEE ALSO
1177d17799eSRuslan Ermilov.Xr hesiod.conf 5 ,
1187d17799eSRuslan Ermilov.Xr named 8
1197d17799eSRuslan Ermilov.Rs
1207d17799eSRuslan Ermilov.%T "Hesiod - Project Athena Technical Plan -- Name Service"
1217d17799eSRuslan Ermilov.Re
1227d17799eSRuslan Ermilov.Sh ERRORS
123248aee62SJacques VidrineHesiod calls may fail because of:
1247d17799eSRuslan Ermilov.Bl -tag -width Er
1257d17799eSRuslan Ermilov.It Bq Er ENOMEM
126248aee62SJacques VidrineInsufficient memory was available to carry out the requested
127248aee62SJacques Vidrineoperation.
1287d17799eSRuslan Ermilov.It Bq Er ENOEXEC
1291fae73b1SRuslan ErmilovThe
1307d17799eSRuslan Ermilov.Fn hesiod_init
1311fae73b1SRuslan Ermilovfunction
132248aee62SJacques Vidrinefailed because the Hesiod configuration file was invalid.
1337d17799eSRuslan Ermilov.It Bq Er ECONNREFUSED
1341fae73b1SRuslan ErmilovThe
1357d17799eSRuslan Ermilov.Fn hesiod_resolve
1361fae73b1SRuslan Ermilovfunction
137248aee62SJacques Vidrinefailed because no name server could be contacted to answer the query.
1387d17799eSRuslan Ermilov.It Bq Er EMSGSIZE
1391fae73b1SRuslan ErmilovThe
1407d17799eSRuslan Ermilov.Fn hesiod_resolve
141248aee62SJacques Vidrineor
1427d17799eSRuslan Ermilov.Fn hesiod_to_bind
1431fae73b1SRuslan Ermilovfunction
144248aee62SJacques Vidrinefailed because the query or response was too big to fit into the
145248aee62SJacques Vidrinepacket buffers.
1467d17799eSRuslan Ermilov.It Bq Er ENOENT
1471fae73b1SRuslan ErmilovThe
1487d17799eSRuslan Ermilov.Fn hesiod_resolve
1491fae73b1SRuslan Ermilovfunction
150248aee62SJacques Vidrinefailed because the name server had no text records matching
1517d17799eSRuslan Ermilov.Fa name
152248aee62SJacques Vidrineand
1537d17799eSRuslan Ermilov.Fa type ,
154248aee62SJacques Vidrineor
1557d17799eSRuslan Ermilov.Fn hesiod_to_bind
156248aee62SJacques Vidrinefailed because the
1577d17799eSRuslan Ermilov.Fa name
158248aee62SJacques Vidrineargument had a domain extension which could not be resolved with type
1597d17799eSRuslan Ermilov.Dq rhs\-extension
1607d17799eSRuslan Ermilovin the local Hesiod domain.
1617d17799eSRuslan Ermilov.El
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