1HESIOD(3) Library Functions Manual HESIOD(3)
2
3
4
6 hesiod, hesiod_init, hesiod_resolve, hesiod_free_list, hesiod_to_bind,
7 hesiod_end - Hesiod name server interface library
8
10 #include <hesiod.h>
11
12 int hesiod_init(void **context)
13 char **hesiod_resolve(void *context, const char *name,
14 const char *type)
15 void hesiod_free_list(void *context, char **list);
16 char *hesiod_to_bind(void *context, const char *name,
17 const char *type)
18 void hesiod_end(void *context)
19
21 This family of functions allows you to perform lookups of Hesiod infor‐
22 mation, which is stored as text records in the Domain Name Service. To
23 perform lookups, you must first initialize a context, an opaque object
24 which stores information used internally by the library between calls.
25 hesiod_init initializes a context, storing a pointer to the context in
26 the location pointed to by the context argument. hesiod_end frees the
27 resources used by a context.
28
29 hesiod_resolve is the primary interface to the library. If successful,
30 it returns a list of one or more strings giving the records matching
31 name and type. The last element of the list is followed by a NULL
32 pointer. It is the caller's responsibility to call hesiod_free_list to
33 free the resources used by the returned list.
34
35 hesiod_to_bind converts name and type into the DNS name used by hes‐
36 iod_resolve. It is the caller's responsibility to free the returned
37 string using free.
38
40 If successful, hesiod_init returns 0; otherwise it returns -1 and sets
41 errno to indicate the error. On failure, hesiod_resolve and hes‐
42 iod_to_bind return NULL and set the global variable errno to indicate
43 the error.
44
46 If the environment variable HES_DOMAIN is set, it will override the
47 domain in the Hesiod configuration file. If the environment variable
48 HESIOD_CONFIG is set, it specifies the location of the Hesiod configu‐
49 ration file.
50
52 `Hesiod - Project Athena Technical Plan -- Name Service', named(8),
53 hesiod.conf(5)
54
56 Hesiod calls may fail because of:
57
58 ENOMEM Insufficient memory was available to carry out the requested
59 operation.
60
61 ENOEXEC
62 hesiod_init failed because the Hesiod configuration file was
63 invalid.
64
65 ECONNREFUSED
66 hesiod_resolve failed because no name server could be contacted
67 to answer the query.
68
69 EMSGSIZE
70 hesiod_resolve failed because the query or response was too big
71 to fit into the packet buffers.
72
73 ENOENT hesiod_resolve failed because the name server had no text
74 records matching name and type, or hesiod_to_bind failed because
75 the name argument had a domain extension which could not be
76 resolved with type ``rhs-extension'' in the local Hesiod domain.
77
79 Steve Dyer, IBM/Project Athena
80 Greg Hudson, MIT Team Athena
81 Copyright 1987, 1988, 1995, 1996 by the Massachusetts Institute of
82 Technology.
83
85 The strings corresponding to the errno values set by the Hesiod func‐
86 tions are not particularly indicative of what went wrong, especially
87 for ENOEXEC and ENOENT.
88
89
90
91 30 November 1996 HESIOD(3)