1 .\" $Id: ares_send.3,v 1.1 1998/08/13 18:07:35 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_SEND 3 "25 July 1998"
19 ares_send \- Initiate a DNS query
24 .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
25 .B unsigned char *\fIabuf\fP, int \fIalen\fP)
28 void ares_send(ares_channel \fIchannel\fP, const unsigned char *\fIqbuf\fP,
29 .B int \fIqlen\fP, ares_callback \fIcallback\fP, void *\fIarg\fP)
34 function initiates a DNS query on the name service channel identified
41 give the DNS query, which should already have been formatted according
42 to the DNS protocol. When the query is complete or has failed, the
43 ares library will invoke
45 Completion or failure of the query may happen immediately, or may
46 happen during a later call to
59 indicates whether the query succeeded and, if not, how it failed. It
60 may have any of the following values:
66 The query buffer was poorly formed (was not long enough for a DNS
67 header or was too long for TCP transmission).
70 No name servers responded within the timeout period.
73 No name servers could be contacted.
79 The name service channel
81 is being destroyed; the query will not be completed.
83 If the query completed, the callback argument
85 points to a result buffer of length
87 If the query did not complete,
94 .B ARES_FLAG_NOCHECKRESP
95 was set at channel initialization time,
97 will normally ignore responses whose questions do not match the
100 as well as responses with reply codes of
105 Unlike other query functions in the ares library, however,
107 does not inspect the header of the reply packet to determine the error
108 status, so a callback status of
110 does not reflect as much about the response as for other query
115 Greg Hudson, MIT Information Systems
117 Copyright 1998 by the Massachusetts Institute of Technology.