diff options
Diffstat (limited to 'ares_create_query.3')
-rw-r--r-- | ares_create_query.3 | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/ares_create_query.3 b/ares_create_query.3 index 5fd94fc..59af0f0 100644 --- a/ares_create_query.3 +++ b/ares_create_query.3 @@ -18,45 +18,39 @@ ares_create_query \- Compose a single-question DNS query buffer .SH SYNOPSIS .nf -.B #include <ares.h> -.PP -.B int ares_create_query(const char *\fIname\fP, int \fIdnsclass\fP,\ - int \fItype\fP, -.B unsigned short \fIid\fP, int \fIrd\fP,\ - unsigned char **\fIbuf\fP, -.B int *\fIbuflen\fP, int \fImax_udp_size\fP) +#include <ares.h> + +int ares_create_query(const char *\fIname\fP, + int \fIdnsclass\fP, + int \fItype\fP, + unsigned short \fIid\fP, + int \fIrd\fP, + unsigned char **\fIbuf\fP, + int *\fIbuflen\fP, + int \fImax_udp_size\fP) .fi .SH DESCRIPTION -The -.B ares_create_query -function composes a DNS query with a single question. -The parameter -.I name -gives the query name as a NUL-terminated C string of period-separated -labels optionally ending with a period; periods and backslashes within -a label must be escaped with a backlash. The parameters -.I dnsclass -and -.I type -give the class and type of the query using the values defined in -.BR <arpa/nameser.h> . -The parameter -.I id -gives a 16-bit identifier for the query. The parameter -.I rd -should be nonzero if recursion is desired, zero if not. The query -will be placed in an allocated buffer, a pointer to which will be -stored in the variable pointed to by -.IR buf , -and the length of which will be stored in the variable pointed to by -.IR buflen . +The \fIares_create_query(3)\fP function composes a DNS query with a single +question. The parameter \fIname\fP gives the query name as a NUL-terminated C +string of period-separated labels optionally ending with a period; periods and +backslashes within a label must be escaped with a backlash. + +The parameters \fIdnsclass\fP and \fItype\fP give the class and type of the +query using the values defined in \fB<arpa/nameser.h>\fP. + +The parameter \fIid\fP gives a 16-bit identifier for the query. + +The parameter \fIrd\fP should be nonzero if recursion is desired, zero if not. + +The query will be placed in an allocated buffer, a pointer to which will be +stored in the variable pointed to by \fIbuf\fP, and the length of which will +be stored in the variable pointed to by \fIbuflen\fP. + It is the caller's responsibility to free this buffer using -\fIares_free_string(3)\fP when it is no longer needed. -The parameter -.I max_udp_size -should be nonzero to activate EDNS. Usage of \fIares_create_query(3)\fP\ with -.I max_udp_size -set to zero is equivalent to \fIares_mkquery(3)\fP. +\fIares_free_string(3)\fP when it is no longer needed. The parameter +\fImax_udp_size\fP should be nonzero to activate EDNS. Usage of +\fIares_create_query(3)\fP\ with \fImax_udp_size\fP set to zero is equivalent +to using \fIares_mkquery(3)\fP. .SH RETURN VALUES .B ares_create_query can return any of the following values: @@ -77,5 +71,6 @@ Memory was exhausted. Added in c-ares 1.10.0 .SH SEE ALSO .BR ares_expand_name (3), -.BR ares_free_string (3) +.BR ares_free_string (3), +.BR ares_mkquery (3) .SH AUTHOR |