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