📄 ares_mkquery.3
字号:
.\".\" Copyright 1998, 2000 by the Massachusetts Institute of Technology..\".\" Permission to use, copy, modify, and distribute this.\" software and its documentation for any purpose and without.\" fee is hereby granted, provided that the above copyright.\" notice appear in all copies and that both that copyright.\" notice and this permission notice appear in supporting.\" documentation, and that the name of M.I.T. not be used in.\" advertising or publicity pertaining to distribution of the.\" software without specific, written prior permission..\" M.I.T. makes no representations about the suitability of.\" this software for any purpose. It is provided "as is".\" without express or implied warranty..\".TH ARES_MKQUERY 3 "4 January 2000".SH NAMEares_mkquery \- Compose a single-question DNS query buffer.SH SYNOPSIS.nf.B #include <ares.h>.PP.Bint ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,.B unsigned short \fIid\fP, int \fIrd\fP, char **\fIbuf\fP, int *\fIbuflen\fP).fi.SH DESCRIPTIONThe.B ares_mkqueryfunction composes a DNS query with a single question.The parameter.I namegives the query name as a NUL-terminated C string of period-separatedlabels optionally ending with a period; periods and backslashes withina label must be escaped with a backlash. The parameters.I dnsclassand.I typegive the class and type of the query using the values defined in.BR <arpa/nameser.h> .The parameter.I idgives a 16-bit identifier for the query. The parameter.I rdshould be nonzero if recursion is desired, zero if not. The querywill be placed in an allocated buffer, a pointer to which will bestored in the variable pointed to by.IR buf ,and the length of which will be stored in the variable pointed to by.IR buflen .It is the caller's responsibility to free this buffer using.B ares_free_stringwhen it is no longer needed..SH RETURN VALUES.B ares_mkquerycan return any of the following values:.TP 15.B ARES_SUCCESSConstruction of the DNS query succeeded..TP 15.B ARES_EBADNAMEThe query name.I namecould not be encoded as a domain name, either because it contained azero-length label or because it contained a label of more than 63characters..TP 15.B ARES_ENOMEMMemory was exhausted..SH SEE ALSO.BR ares_expand_name (3),.BR ares_free_string (3).SH AUTHORGreg Hudson, MIT Information Systems.brCopyright 1998, 2000 by the Massachusetts Institute of Technology.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -