2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose. It is provided "as is"
14 .\" without express or implied warranty.
16 .TH ARES_SEND 3 "25 July 1998"
18 ares_send \- Initiate a DNS query
23 .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
24 .B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP)
26 .B void ares_send(ares_channel \fIchannel\fP, const unsigned char *\fIqbuf\fP,
27 .B int \fIqlen\fP, ares_callback \fIcallback\fP, void *\fIarg\fP)
32 function initiates a DNS query on the name service channel identified
39 give the DNS query, which should already have been formatted according
40 to the DNS protocol. When the query is complete or has failed, the
41 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:
64 The query buffer was poorly formed (was not long enough for a DNS
65 header or was too long for TCP transmission).
68 No name servers responded within the timeout period.
71 No name servers could be contacted.
77 The name service channel
79 is being destroyed; the query will not be completed.
83 reports how many times a query timed out during the execution of the
86 If the query completed, the callback argument
88 points to a result buffer of length
90 If the query did not complete,
97 .B ARES_FLAG_NOCHECKRESP
98 was set at channel initialization time,
100 will normally ignore responses whose questions do not match the
103 as well as responses with reply codes of
108 Unlike other query functions in the ares library, however,
110 does not inspect the header of the reply packet to determine the error
111 status, so a callback status of
113 does not reflect as much about the response as for other query
118 Greg Hudson, MIT Information Systems
120 Copyright 1998 by the Massachusetts Institute of Technology.