1 .\" $Id: ares_gethostbyname.3,v 1.1 1998/08/13 18:07:31 ghudson Exp $
3 .\" Copyright 1998 by the Massachusetts Institute of Technology.
5 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose. It is provided "as is"
15 .\" without express or implied warranty.
17 .TH ARES_GETHOSTBYNAME 3 "25 July 1998"
19 ares_gethostbyname \- Initiate a host query by name
24 .B typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP,
25 .B struct hostent *\fIhostent\fP)
27 .B void ares_gethostbyname(ares_channel \fIchannel\fP, const char *\fIname\fP,
28 .B int \fIfamily\fP, ares_host_callback \fIcallback\fP, void *\fIarg\fP)
33 function initiates a host query by name on the name service channel
38 gives the hostname as a NUL-terminated C string, and
40 gives the desired type of address for the resulting host entry. When
41 the query is complete or has failed, the ares library will invoke
43 Completion or failure of the query may happen immediately, or may
44 happen during a later call to
57 indicates whether the query succeeded and, if not, how it failed. It
58 may have any of the following values:
61 The host lookup completed successfully.
64 The ares library does not know how to find addresses of type
70 is composed entirely of numbers and periods, but is not a valid
71 representation of an Internet address.
82 The name service channel
84 is being destroyed; the query will not be completed.
86 On successful completion of the query, the callback argument
90 containing the name of the host returned by the query. The callback
91 need not and should not attempt to free the memory pointed to by
93 the ares library will free it when the callback returns. If the query
94 did not complete successfully,
101 Greg Hudson, MIT Information Systems
103 Copyright 1998 by the Massachusetts Institute of Technology.