xref: /netbsd-src/external/bsd/libbind/dist/doc/hesiod.cat3 (revision 5bbd2a12505d72a8177929a37b5cee489d0a1cfd)
1b5677b36SchristosHESIOD(3)                                                            HESIOD(3)
2b5677b36Schristos
3b5677b36Schristos
4b5677b36Schristos
5b5677b36SchristosNNAAMMEE
6b5677b36Schristos       hesiod,  hesiod_init, hesiod_resolve, hesiod_free_list, hesiod_to_bind,
7b5677b36Schristos       hesiod_end - Hesiod name server interface library
8b5677b36Schristos
9b5677b36SchristosSSYYNNOOPPSSIISS
10b5677b36Schristos       ##iinncclluuddee <<hheessiioodd..hh>>
11b5677b36Schristos
12b5677b36Schristos       iinntt hheessiioodd__iinniitt((vvooiidd ****_c_o_n_t_e_x_t))
13b5677b36Schristos       cchhaarr ****hheessiioodd__rreessoollvvee((vvooiidd **_c_o_n_t_e_x_t,, ccoonnsstt cchhaarr **_n_a_m_e,,
14b5677b36Schristos            ccoonnsstt cchhaarr **_t_y_p_e))
15b5677b36Schristos       vvooiidd hheessiioodd__ffrreeee__lliisstt((vvooiidd **_c_o_n_t_e_x_t,, cchhaarr ****_l_i_s_t));;
16b5677b36Schristos       cchhaarr **hheessiioodd__ttoo__bbiinndd((vvooiidd **_c_o_n_t_e_x_t,, ccoonnsstt cchhaarr **_n_a_m_e,,
17b5677b36Schristos            ccoonnsstt cchhaarr **_t_y_p_e))
18b5677b36Schristos       vvooiidd hheessiioodd__eenndd((vvooiidd **_c_o_n_t_e_x_t))
19b5677b36Schristos
20b5677b36SchristosDDEESSCCRRIIPPTTIIOONN
21*5bbd2a12Schristos       This family of functions allows you to perform lookups of Hesiod infor-
22b5677b36Schristos       mation, which is stored as text records in the Domain Name Service.  To
23b5677b36Schristos       perform lookups, you must first initialize a _c_o_n_t_e_x_t, an opaque  object
24b5677b36Schristos       which  stores information used internally by the library between calls.
25b5677b36Schristos       _h_e_s_i_o_d___i_n_i_t initializes a context, storing a pointer to the context  in
26b5677b36Schristos       the  location pointed to by the _c_o_n_t_e_x_t argument.  _h_e_s_i_o_d___e_n_d frees the
27b5677b36Schristos       resources used by a context.
28b5677b36Schristos
29b5677b36Schristos       _h_e_s_i_o_d___r_e_s_o_l_v_e is the primary interface to the library.  If successful,
30b5677b36Schristos       it  returns  a  list of one or more strings giving the records matching
31b5677b36Schristos       _n_a_m_e and _t_y_p_e.  The last element of the list  is  followed  by  a  NULL
32*5bbd2a12Schristos       pointer.  It is the caller's responsibility to call _h_e_s_i_o_d___f_r_e_e___l_i_s_t to
33b5677b36Schristos       free the resources used by the returned list.
34b5677b36Schristos
35*5bbd2a12Schristos       _h_e_s_i_o_d___t_o___b_i_n_d converts _n_a_m_e and _t_y_p_e into the DNS name  used  by  _h_e_s_-
36*5bbd2a12Schristos       _i_o_d___r_e_s_o_l_v_e.   It  is  the caller's responsibility to free the returned
37b5677b36Schristos       string using _f_r_e_e.
38b5677b36Schristos
39b5677b36SchristosRREETTUURRNN VVAALLUUEESS
40b5677b36Schristos       If successful, _h_e_s_i_o_d___i_n_i_t returns 0; otherwise it returns -1 and  sets
41*5bbd2a12Schristos       _e_r_r_n_o  to  indicate  the  error.   On  failure, _h_e_s_i_o_d___r_e_s_o_l_v_e and _h_e_s_-
42b5677b36Schristos       _i_o_d___t_o___b_i_n_d return NULL and set the global variable _e_r_r_n_o  to  indicate
43b5677b36Schristos       the error.
44b5677b36Schristos
45b5677b36SchristosEENNVVIIRROONNMMEENNTT
46b5677b36Schristos       If  the  environment  variable  HHEESS__DDOOMMAAIINN is set, it will override the
47b5677b36Schristos       domain in the Hesiod configuration file.  If the  environment  variable
48*5bbd2a12Schristos       HHEESSIIOODD__CCOONNFFIIGG  is set, it specifies the location of the Hesiod configu-
49b5677b36Schristos       ration file.
50b5677b36Schristos
51b5677b36SchristosSSEEEE AALLSSOO
52*5bbd2a12Schristos       `Hesiod - Project Athena Technical Plan -- Name Service'
53b5677b36Schristos
54b5677b36SchristosEERRRROORRSS
55b5677b36Schristos       Hesiod calls may fail because of:
56b5677b36Schristos
57b5677b36Schristos       ENOMEM Insufficient memory was available to  carry  out  the  requested
58b5677b36Schristos              operation.
59b5677b36Schristos
60b5677b36Schristos       ENOEXEC
61b5677b36Schristos              _h_e_s_i_o_d___i_n_i_t  failed  because  the  Hesiod configuration file was
62b5677b36Schristos              invalid.
63b5677b36Schristos
64b5677b36Schristos       ECONNREFUSED
65b5677b36Schristos              _h_e_s_i_o_d___r_e_s_o_l_v_e failed because no name server could be  contacted
66b5677b36Schristos              to answer the query.
67b5677b36Schristos
68b5677b36Schristos       EMSGSIZE
69b5677b36Schristos              _h_e_s_i_o_d___r_e_s_o_l_v_e  failed because the query or response was too big
70b5677b36Schristos              to fit into the packet buffers.
71b5677b36Schristos
72b5677b36Schristos       ENOENT _h_e_s_i_o_d___r_e_s_o_l_v_e failed  because  the  name  server  had  no  text
73b5677b36Schristos              records matching _n_a_m_e and _t_y_p_e, or _h_e_s_i_o_d___t_o___b_i_n_d failed because
74b5677b36Schristos              the _n_a_m_e argument had a domain  extension  which  could  not  be
75*5bbd2a12Schristos              resolved with type ``rhs-extension'' in the local Hesiod domain.
76b5677b36Schristos
77b5677b36SchristosAAUUTTHHOORR
78b5677b36Schristos       Steve Dyer, IBM/Project Athena
79b5677b36Schristos       Greg Hudson, MIT Team Athena
80b5677b36Schristos       Copyright 1987, 1988, 1995, 1996  by  the  Massachusetts  Institute  of
81b5677b36Schristos       Technology.
82b5677b36Schristos
83b5677b36SchristosBBUUGGSS
84*5bbd2a12Schristos       The  strings  corresponding to the _e_r_r_n_o values set by the Hesiod func-
85b5677b36Schristos       tions are not particularly indicative of what  went  wrong,  especially
86b5677b36Schristos       for _E_N_O_E_X_E_C and _E_N_O_E_N_T.
87b5677b36Schristos
88b5677b36Schristos
89b5677b36Schristos
90b5677b36Schristos                               30 November 1996                      HESIOD(3)
91