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, 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
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_ECANCELLED The query was cancelled.
42
43 ARES_EDESTRUCTION The name service channel channel is being destroyed;
44 the query will not be completed.
45
46 The callback argument timeouts reports how many times a query timed out
47 during the execution of the given request.
48
49 On successful completion of the query, the callback argument hostent
50 points to a struct hostent containing the name of the host returned by
51 the query. The callback need not and should not attempt to free the
52 memory pointed to by hostent; the ares library will free it when the
53 callback returns. If the query did not complete successfully, hostent
54 will be NULL.
55
57 ares_process(3), ares_gethostbyname(3)
58
60 Greg Hudson, MIT Information Systems
61 Copyright 1998 by the Massachusetts Institute of Technology.
62
63
64
65 24 July 1998 ARES_GETHOSTBYADDR(3)