/[resiprocate]/main/contrib/ares/ares_mkquery.3
ViewVC logotype

Contents of /main/contrib/ares/ares_mkquery.3

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5295 - (show annotations) (download)
Mon Aug 22 00:30:05 2005 UTC (14 years, 2 months ago) by jason
File size: 2472 byte(s)
merged 5270:HEAD from b-directory-reorg
1 .\"
2 .\" Copyright 1998, 2000 by the Massachusetts Institute of Technology.
3 .\"
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.
15 .\"
16 .TH ARES_MKQUERY 3 "4 January 2000"
17 .SH NAME
18 ares_mkquery \- Compose a single-question DNS query buffer
19 .SH SYNOPSIS
20 .nf
21 .B #include <ares.h>
22 .PP
23 .B
24 int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
25 .B
26 unsigned short \fIid\fP, int \fIrd\fP, char **\fIbuf\fP,
27 int *\fIbuflen\fP)
28 .fi
29 .SH DESCRIPTION
30 The
31 .B ares_mkquery
32 function composes a DNS query with a single question.
33 The parameter
34 .I name
35 gives the query name as a NUL-terminated C string of period-separated
36 labels optionally ending with a period; periods and backslashes within
37 a label must be escaped with a backlash. The parameters
38 .I dnsclass
39 and
40 .I type
41 give the class and type of the query using the values defined in
42 .BR <arpa/nameser.h> .
43 The parameter
44 .I id
45 gives a 16-bit identifier for the query. The parameter
46 .I rd
47 should be nonzero if recursion is desired, zero if not. The query
48 will be placed in an allocated buffer, a pointer to which will be
49 stored in the variable pointed to by
50 .IR buf ,
51 and the length of which will be stored in the variable pointed to by
52 .IR buflen .
53 It is the caller's responsibility to free this buffer using
54 .B ares_free_string
55 when it is no longer needed.
56 .SH RETURN VALUES
57 .B ares_mkquery
58 can return any of the following values:
59 .TP 15
60 .B ARES_SUCCESS
61 Construction of the DNS query succeeded.
62 .TP 15
63 .B ARES_EBADNAME
64 The query name
65 .I name
66 could not be encoded as a domain name, either because it contained a
67 zero-length label or because it contained a label of more than 63
68 characters.
69 .TP 15
70 .B ARES_ENOMEM
71 Memory was exhausted.
72 .SH SEE ALSO
73 .BR ares_expand_name (3),
74 .BR ares_free_string (3)
75 .SH AUTHOR
76 Greg Hudson, MIT Information Systems
77 .br
78 Copyright 1998, 2000 by the Massachusetts Institute of Technology.

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27