Blame ares_mkquery.3

Packit 514978
.\"
Packit 514978
.\" Copyright 1998, 2000 by the Massachusetts Institute of Technology.
Packit 514978
.\"
Packit 514978
.\" Permission to use, copy, modify, and distribute this
Packit 514978
.\" software and its documentation for any purpose and without
Packit 514978
.\" fee is hereby granted, provided that the above copyright
Packit 514978
.\" notice appear in all copies and that both that copyright
Packit 514978
.\" notice and this permission notice appear in supporting
Packit 514978
.\" documentation, and that the name of M.I.T. not be used in
Packit 514978
.\" advertising or publicity pertaining to distribution of the
Packit 514978
.\" software without specific, written prior permission.
Packit 514978
.\" M.I.T. makes no representations about the suitability of
Packit 514978
.\" this software for any purpose.  It is provided "as is"
Packit 514978
.\" without express or implied warranty.
Packit 514978
.\"
Packit 514978
.TH ARES_MKQUERY 3 "20 Nov 2009"
Packit 514978
.SH NAME
Packit 514978
ares_mkquery \- Compose a single-question DNS query buffer
Packit 514978
.SH SYNOPSIS
Packit 514978
.nf
Packit 514978
.B #include <ares.h>
Packit 514978
.PP
Packit 514978
.B int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
Packit 514978
.B	unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP,
Packit 514978
.B	int *\fIbuflen\fP)
Packit 514978
.fi
Packit 514978
.SH DESCRIPTION
Packit 514978
Deprecated function. See \fIares_create_query(3)\fP instead!
Packit 514978
Packit 514978
The
Packit 514978
.B ares_mkquery
Packit 514978
function composes a DNS query with a single question.
Packit 514978
The parameter
Packit 514978
.I name
Packit 514978
gives the query name as a NUL-terminated C string of period-separated
Packit 514978
labels optionally ending with a period; periods and backslashes within
Packit 514978
a label must be escaped with a backlash.  The parameters
Packit 514978
.I dnsclass
Packit 514978
and
Packit 514978
.I type
Packit 514978
give the class and type of the query using the values defined in
Packit 514978
.BR <arpa/nameser.h> .
Packit 514978
The parameter
Packit 514978
.I id
Packit 514978
gives a 16-bit identifier for the query.  The parameter
Packit 514978
.I rd
Packit 514978
should be nonzero if recursion is desired, zero if not.  The query
Packit 514978
will be placed in an allocated buffer, a pointer to which will be
Packit 514978
stored in the variable pointed to by
Packit 514978
.IR buf ,
Packit 514978
and the length of which will be stored in the variable pointed to by
Packit 514978
.IR buflen .
Packit 514978
It is the caller's responsibility to free this buffer using
Packit 514978
\fIares_free_string(3)\fP when it is no longer needed.
Packit 514978
Packit 514978
Usage of \fIares_mkquery(3)\fP is deprecated, whereas the function is
Packit 514978
equivalent to \fIares_create_query(3)\fP with \fBmax_udp_size\fP set to
Packit 514978
0.
Packit 514978
Packit 514978
.SH RETURN VALUES
Packit 514978
.B ares_mkquery
Packit 514978
can return any of the following values:
Packit 514978
.TP 15
Packit 514978
.B ARES_SUCCESS
Packit 514978
Construction of the DNS query succeeded.
Packit 514978
.TP 15
Packit 514978
.B ARES_EBADNAME
Packit 514978
The query name
Packit 514978
.I name
Packit 514978
could not be encoded as a domain name, either because it contained a
Packit 514978
zero-length label or because it contained a label of more than 63
Packit 514978
characters.
Packit 514978
.TP 15
Packit 514978
.B ARES_ENOMEM
Packit 514978
Memory was exhausted.
Packit 514978
.SH SEE ALSO
Packit 514978
.BR ares_expand_name (3),
Packit 514978
.BR ares_free_string (3)
Packit 514978
.SH AUTHOR
Packit 514978
Greg Hudson, MIT Information Systems
Packit 514978
.br
Packit 514978
Copyright 1998, 2000 by the Massachusetts Institute of Technology.