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       int timeouts, 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       The callback argument timeouts reports how many times a query timed out
45       during the execution of the given request.
46
47       On  successful  completion  of the query, the callback argument hostent
48       points to a struct hostent containing the name of the host returned  by
49       the  query.   The  callback need not and should not attempt to free the
50       memory pointed to by hostent; the ares library will free  it  when  the
51       callback  returns.  If the query did not complete successfully, hostent
52       will be NULL.
53

SEE ALSO

55       ares_process(3), ares_gethostbyname(3)
56

AUTHOR

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