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