hesiod_resolve(3) - Linux man page
Name
hesiod, hesiod_init, hesiod_resolve, hesiod_free_list, hesiod_to_bind, hesiod_free_string, hesiod_end - Hesiod name server interface librarySynopsis
#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_free_string(void *context, char *str);char **hesiod_parse_result(void *context,unsigned const char *result, int rlen)void hesiod_end(void *context) cc file.c -lhesiod
Description
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 hesiod_free_string.
hesiod_parse_result parses the result of a name server query into text records. It is the caller's responsibility to call hesiod_free_list to free the resources used by the returned list.
Return Values
If successful, hesiod_init returns 0; otherwise it returns -1 and sets errno to indicate the error. On failure, hesiod_resolve and hesiod_to_bind return NULL and set the global variable errno to indicate the error.Environment
If the environment variable HES_DOMAIN is set, it will override the domain in the Hesiod configuration file. If the environment variable HESIOD_CONFIG is set, it specifies the location of the Hesiod configuration file.See Also
'Hesiod - Project Athena Technical Plan -- Name Service', named(8), hesiod.conf(5)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 answer 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 argument had a domain extension which could not be resolved with type ''rhs-extension'' in the local Hesiod domain.
Author
Steve Dyer, IBM/Project AthenaGreg Hudson, MIT Team Athena
Copyright 1987, 1988, 1995, 1996, 2000 by the Massachusetts Institute of Technology.