1ARES_GETHOSTBYADDR(3) Library Functions Manual ARES_GETHOSTBYADDR(3)
2
3
4
6 ares_gethostbyaddr - Initiate a host query by address
7
9 #include <ares.h>
10
11 typedef void (*ares_host_callback)(void *arg, int status,
12 int timeouts,
13 struct hostent *hostent)
14
15 void ares_gethostbyaddr(ares_channel channel, const void *addr,
16 int addrlen, int family,
17 ares_host_callback callback, void *arg)
18
20 The ares_gethostbyaddr function initiates a host query by address on
21 the name service channel identified by channel. The parameters addr
22 and addrlen give the address as a series of bytes, and family gives the
23 type of address. When the query is complete or has failed, the ares
24 library will invoke callback. Completion or failure of the query may
25 happen immediately, or may happen during a later call to
26 ares_process(3), ares_destroy(3) or ares_cancel(3).
27
28 The callback argument arg is copied from the ares_gethostbyaddr argu‐
29 ment arg. The callback argument status indicates whether the query
30 succeeded and, if not, how it failed. It may have any of the following
31 values:
32
33 ARES_SUCCESS The host lookup completed successfully.
34
35 ARES_ENOTIMP The ares library does not know how to look up ad‐
36 dresses of type family.
37
38 ARES_ENOTFOUND The address addr was not found.
39
40 ARES_ENOMEM Memory was exhausted.
41
42 ARES_ECANCELLED The query was cancelled.
43
44 ARES_EDESTRUCTION The name service channel channel is being destroyed;
45 the query will not be completed.
46
47 The callback argument timeouts reports how many times a query timed out
48 during the execution of the given request.
49
50 On successful completion of the query, the callback argument hostent
51 points to a struct hostent containing the name of the host returned by
52 the query. The callback need not and should not attempt to free the
53 memory pointed to by hostent; the ares library will free it when the
54 callback returns. If the query did not complete successfully, hostent
55 will be NULL.
56
58 ares_process(3), ares_gethostbyname(3)
59
61 Greg Hudson, MIT Information Systems
62 Copyright 1998 by the Massachusetts Institute of Technology.
63
64
65
66 24 July 1998 ARES_GETHOSTBYADDR(3)