summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/linux/net/hesiod.3
blob: 8de1f9247e4b4c85e1213a602af4f34e5f04d46f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
HESIOD(3)                          BSD Library Functions Manual                         HESIOD(3)

NAME
     hesiod, hesiod_init, hesiod_resolve, hesiod_free_list, hesiod_to_bind, hesiod_end -- Hesiod
     name server interface library

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <hesiod.h>

     int
     hesiod_init(void **context);

     char **
     hesiod_resolve(void *context, const char *name, const char *type);

     void
     hesiod_free_list(void *context, char **list);

     char *
     hesiod_to_bind(void *context, const char *name, const char *type);

     void
     hesiod_end(void *context);

DESCRIPTION
     This family of functions allows you to perform lookups of Hesiod information, which is
     stored as text records in the Domain Name Service.  To perform lookups, you must first ini-
     tialize a context, an opaque object which stores information used internally by the library
     between calls.  hesiod_init() initializes a context, storing a pointer to the context in the
     location pointed to by the context argument.  hesiod_end() frees the resources used by a
     context.

     hesiod_resolve() is the primary interface to the library.  If successful, it returns a list
     of one or more strings giving the records matching name and type.  The last element of the
     list is followed by a NULL pointer.  It is the caller's responsibility to call
     hesiod_free_list() to free the resources used by the returned list.

     hesiod_to_bind() converts name and type into the DNS name used by hesiod_resolve().  It is
     the caller's responsibility to free the returned string using free().

RETURN VALUES
     The hesiod_init() function returns the value 0 if successful; otherwise the value -1 is re-
     turned and the global variable errno is set to indicate the error.  On failure,
     hesiod_resolve() and hesiod_to_bind() return NULL and set the global variable errno to indi-
     cate the error.

ENVIRONMENT
     HES_DOMAIN     If the environment variable HES_DOMAIN is set, it will override the domain in
                    the Hesiod configuration file.

     HESIOD_CONFIG  If the environment variable HESIOD_CONFIG is set, it specifies the location
                    of the Hesiod configuration file.

SEE ALSO
     hesiod.conf(5), named(8)

     Hesiod - Project Athena Technical Plan -- Name Service.

ERRORS
     Hesiod calls may fail because of:

     [ENOMEM]           Insufficient memory was available to carry out the requested operation.

     [ENOEXEC]          hesiod_init() failed because the Hesiod configuration file was invalid.

     [ECONNREFUSED]     hesiod_resolve() failed because no name server could be contacted to an-
                        swer the query.

     [EMSGSIZE]         hesiod_resolve() or hesiod_to_bind() failed because the query or response
                        was too big to fit into the packet buffers.

     [ENOENT]           hesiod_resolve() failed because the name server had no text records
                        matching name and type, or hesiod_to_bind() failed because the name argu-
                        ment had a domain extension which could not be resolved with type
                        "rhs-extension" in the local Hesiod domain.

AUTHORS
     Steve Dyer, IBM/Project Athena
     Greg Hudson, MIT Team Athena

     Copyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of Technology.

BUGS
     The strings corresponding to the errno values set by the Hesiod functions are not particu-
     larly indicative of what went wrong, especially for ENOEXEC and ENOENT.

BSD                                     November 30, 1996                                     BSD