1ARES_GETHOSTBYADDR(3)      Library Functions Manual      ARES_GETHOSTBYADDR(3)
2
3
4

NAME

6       ares_gethostbyaddr - Initiate a host query by address
7

SYNOPSIS

9       #include <ares.h>
10
11       typedef void (*ares_host_callback)(void *arg, int status,
12       struct hostent *hostent)
13
14       void ares_gethostbyaddr(ares_channel channel, const void *addr,
15            int addrlen, int family, ares_host_callback callback,
16            void *arg)
17

DESCRIPTION

19       The  ares_gethostbyaddr  function  initiates a host query by address on
20       the name service channel identified by channel.   The  parameters  addr
21       and addrlen give the address as a series of bytes, and family gives the
22       type of address.  When the query is complete or has  failed,  the  ares
23       library  will  invoke callback.  Completion or failure of the query may
24       happen  immediately,  or  may   happen   during   a   later   call   to
25       ares_process(3), ares_destroy(3) or ares_cancel(3).
26
27       The  callback  argument arg is copied from the ares_gethostbyaddr argu‐
28       ment arg.  The callback argument status  indicates  whether  the  query
29       succeeded and, if not, how it failed.  It may have any of the following
30       values:
31
32       ARES_SUCCESS       The host lookup completed successfully.
33
34       ARES_ENOTIMP       The ares library  does  not  know  how  to  look  up
35                          addresses of type family.
36
37       ARES_ENOTFOUND     The address addr was not found.
38
39       ARES_ENOMEM        Memory was exhausted.
40
41       ARES_EDESTRUCTION  The name service channel channel is being destroyed;
42                          the query will not be completed.
43
44       On successful completion of the query, the  callback  argument  hostent
45       points  to a struct hostent containing the name of the host returned by
46       the query.  The callback need not and should not attempt  to  free  the
47       memory  pointed  to  by hostent; the ares library will free it when the
48       callback returns.  If the query did not complete successfully,  hostent
49       will be NULL.
50

SEE ALSO

52       ares_process(3), ares_gethostbyname(3)
53

AUTHOR

55       Greg Hudson, MIT Information Systems
56       Copyright 1998 by the Massachusetts Institute of Technology.
57
58
59
60                                 24 July 1998            ARES_GETHOSTBYADDR(3)
Impressum