source: trunk/athena/lib/ares/ares_mkquery.3 @ 11855

Revision 11855, 2.3 KB checked in by ghudson, 27 years ago (diff)
Documentation for libares, an asynchronous resolver library
Line 
1.\" $Id: ares_mkquery.3,v 1.1 1998-08-13 18:07:32 ghudson Exp $
2.\"
3.\" Copyright 1998 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 "25 July 1998"
18.SH NAME
19ares_mkquery \- Compose a single-question DNS query buffer
20.SH SYNOPSIS
21.nf
22.B #include <ares.h>
23.PP
24.B
25int ares_mkquery(const char *\fIname\fP, int \fIclass\fP, int \fItype\fP,
26.B
27        unsigned short \fIid\fP, char **\fIbuf\fP, int *\fIbuflen\fP)
28.fi
29.SH DESCRIPTION
30The
31.B ares_mkquery
32function composes a DNS query with a single question.
33The parameter
34.I name
35gives the query name as a NUL-terminated C string of period-separated
36labels optionally ending with a period; periods and backslashes within
37a label must be escaped with a backlash.  The parameters
38.I class
39and
40.I type
41give the class and type of the query using the values defined in
42.BR <arpa/nameser.h> .
43The parameter
44.I id
45gives a 16-bit identifier for the query.  The query will be placed in
46an allocated buffer, a pointer to which will be stored in the variable
47pointed to by
48.IR buf ,
49and the length of which will be stored in the variable pointed to by
50.IR buflen .
51It is the caller's responsibility to free this buffer using
52.B free
53when it is no longer needed.
54.SH RETURN VALUES
55.B ares_expand_name
56can return any of the following values:
57.TP 15
58.B ARES_SUCCESS
59Construction of the DNS query succeeded.
60.TP 15
61.B ARES_EBADNAME
62The query name
63.I name
64could not be encoded as a domain name, either because it contained a
65zero-length label or because it contained a label of more than 63
66characters.
67.TP 15
68.B ARES_ENOMEM
69Memory was exhausted.
70.SH SEE ALSO
71.BR ares_expand_name (3)
72.SH AUTHOR
73Greg Hudson, MIT Information Systems
74.br
75Copyright 1998 by the Massachusetts Institute of Technology.
Note: See TracBrowser for help on using the repository browser.