⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ares_query.3

📁 这是国外的resip协议栈
💻 3
字号:
.\".\" Copyright 1998 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_QUERY 3 "24 July 1998".SH NAMEares_query \- Initiate a single-question DNS query.SH SYNOPSIS.nf.B #include <ares.h>.PP.B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,.B	unsigned char *\fIabuf\fP, int \fIalen\fP).PP.B void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP,.B 	int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,.B	void *\fIarg\fP).fi.SH DESCRIPTIONThe.B ares_queryfunction initiates a single-question DNS query on the name servicechannel identified by.IR channel .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 backslash.  The parameters.I dnsclassand.I typegive the class and type of the query using the values defined in.BR <arpa/nameser.h> .When the query is complete or has failed, the ares library will invoke.IR callback .Completion or failure of the query may happen immediately, or mayhappen during a later call to.BR ares_process (3)or.BR ares_destroy (3)..PPThe callback argument.I argis copied from the.B ares_queryargument.IR arg .The callback argument.I statusindicates whether the query succeeded and, if not, how it failed.  Itmay have any of the following values:.TP 19.B ARES_SUCCESSThe query completed successfully..TP 19.B ARES_ENODATAThe query completed but contains no answers..TP 19.B ARES_EFORMERRThe query completed but the server claims that the query wasmalformatted..TP 19.B ARES_ESERVFAILThe query completed but the server claims to have experienced afailure.  (This code can only occur if the.B ARES_FLAG_NOCHECKRESPflag was specified at channel initialization time; otherwise, suchresponses are ignored at the.BR ares_send (3)level.).TP 19.B ARES_ENOTFOUNDThe query completed but the queried-for domain name was not found..TP 19.B ARES_ENOTIMPThe query completed but the server does not implement the operationrequested by the query.  (This code can only occur if the.B ARES_FLAG_NOCHECKRESPflag was specified at channel initialization time; otherwise, suchresponses are ignored at the.BR ares_send (3)level.).TP 19.B ARES_EREFUSEDThe query completed but the server refused the query.  (This code canonly occur if the.B ARES_FLAG_NOCHECKRESPflag was specified at channel initialization time; otherwise, suchresponses are ignored at the.BR ares_send (3)level.).TP 19.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 19.B ARES_ETIMEOUTNo name servers responded within the timeout period..TP 19.B ARES_ECONNREFUSEDNo name servers could be contacted..TP 19.B ARES_ENOMEMMemory was exhausted..TP 19.B ARES_EDESTRUCTIONThe name service channel.I channelis being destroyed; the query will not be completed..PPIf the query completed (even if there was something wrong with it, asindicated by some of the above error codes), the callback argument.I abufpoints to a result buffer of length.IR alen .If the query did not complete,.I abufwill be NULL and.I alenwill be 0..SH SEE ALSO.BR ares_process (3).SH AUTHORGreg Hudson, MIT Information Systems.brCopyright 1998 by the Massachusetts Institute of Technology.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -