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