📄 qdns.3qt
字号:
.TH QDns 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDns \- Asynchronous DNS lookups<h1 align=center>QDns Class Reference.br<small>[ network module ]</small></h1>.br.PP\fC#include <qdns.h>\fR.PPInherits QObject..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBRecordType\fR { None, A, Aaaa, Mx, Srv, Cname, Ptr, Txt }".br.ti -1c.BI "\fBQDns\fR () ".br.ti -1c.BI "\fBQDns\fR ( const QString & " "label" ", RecordType " "rr" " = A ) ".br.ti -1c.BI "\fBQDns\fR ( const QHostAddress & " "address" ", RecordType " "rr" " = Ptr ) ".br.ti -1c.BI "virtual \fB~QDns\fR () ".br.ti -1c.BI "virtual void \fBsetLabel\fR ( const QString & label ) ".br.ti -1c.BI "virtual void \fBsetLabel\fR ( const QHostAddress & address ) ".br.ti -1c.BI "QString \fBlabel\fR () const".br.ti -1c.BI "virtual void \fBsetRecordType\fR ( RecordType " "rr" " = A ) ".br.ti -1c.BI "RecordType \fBrecordType\fR () const".br.ti -1c.BI "bool \fBisWorking\fR () const".br.ti -1c.BI "QValueList<QHostAddress> \fBaddresses\fR () const".br.ti -1c.BI "QValueList<MailServer> \fBmailServers\fR () const".br.ti -1c.BI "QValueList<Server> \fBservers\fR () const".br.ti -1c.BI "QStringList \fBhostNames\fR () const".br.ti -1c.BI "QStringList \fBtexts\fR () const".br.ti -1c.BI "QString \fBcanonicalName\fR () const".br.ti -1c.BI "QStringList \fBqualifiedNames\fR () const".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBresultsReady\fR () ".br.in -1c.SH DESCRIPTIONThe QDns class provides asynchronous DNS lookups..PPBoth Windows and UNIX provides synchronous DNS lookups; Windows provides some asynchronous support too. Neither OS provides asynchronous support for anything other than hostname-to-address mapping..PPQDns rectifies that, by providing asynchronous caching lookups for the record types that we expect modern GUI applications to need in the near future..PPThe class is a bit hard to use (although much simpler than the native APIs); QSocket provides much simpler TCP connection facilities. The aim of QDns is to provide a correct and small API to the DNS: Nothing more. (Correctness implies that the DNS information is correctly cached, and correctly timed out.).PPThe API is made up of a constructor, functions to set the DNS node (the domain in DNS terminology) and record type (setLabel() and setRecordType()), the corresponding getters, an isWorking() function to determine whether QDns is working or reading, a resultsReady() signal, and finally query functions for the result..PPThere is one query function for each RecordType, namely addresses(), mailServers(), servers(), hostNames() and texts(). There are also two generic query functions: canonicalName() return the name you'll presumably end up using (the exact meaning of that depends on the record type) and qualifiedNames() returns a list of the fully qualified names label() maps to..PPSee also QSocket..SS "Member Type Documentation".SH "QDns::RecordType"This enum type defines the record types QDns can handle. The DNS provides many more; these are the ones we've judged to be in current use, useful for GUI programs and important enough to support right away:.TP\fCNone\fR - no information. This exists only so that QDns can have a default..TP\fCA\fR - IPv4 addresses. By far the most common type..TP\fCAaaa\fR - Ipv6 addresses. So far mostly unused..TP\fCMx\fR - Mail eXchanger names. Used for mail delivery..TP\fCSrv\fR - SeRVer names. Generic record type for finding servers. So far mostly unused..TP\fCCname\fR - canonical name. Maps from nicknames to the true name (the canonical name) for a host..TP\fCPtr\fR - name PoinTeR. Maps from IPv4 or IPv6 addresses to hostnames..TP\fCTxt\fR - arbitrary text for domains..IP.PPWe expect that some support for the RFC-2535 extensions will be added in future versions..SH MEMBER FUNCTION DOCUMENTATION.SH "QDns::QDns ()"Constructs a DNS query object with invalid settings both for the label and the search type..SH "QDns::QDns ( const QHostAddress & address, QDns::RecordType rr = Ptr )"Constructs a DNS query object that will return \fIrr\fR information about \fIaddress.\fR The label is set to the IN-ADDR.ARPA domain name. This is useful in combination with the Ptr record type (i.e. if you want to look up a hostname for a given address)..PPThe DNS lookup is started the next time the application enters the event loop. When the result is found the signal resultsReady() is emmitted..PP\fIrr\fR defaults to \fCPtr,\fR that maps addresses to hostnames..SH "QDns::QDns ( const QString & label, QDns::RecordType rr = A )"Constructs a DNS query object that will return \fIrr\fR information about \fIlabel.\fR.PPThe DNS lookup is started the next time the application enters the event loop. When the result is found the signal resultsReady() is emmitted..PP\fIrr\fR defaults to \fCA,\fR IPv4 addresses..SH "QDns::~QDns () \fC[virtual]\fR"Destroys the query object and frees its allocated resources..SH "QValueList<QHostAddress> QDns::addresses () const"Returns a list of the addresses for this name if this QDns object has a recordType() of \fIQDns::A\fR or \fIQDns::Aaaa\fR and the answer is available, or an empty list else..PPAs a special case, if label() is a valid numeric IP address, this function returns that address..SH "QString QDns::canonicalName () const"Returns the canonical name for this DNS node. (This works regardless of what recordType() is set to.).PPIf the canonical name isn't known, this function returns a null string..PPThe canonical name of a DNS node is its full name, or the full name of the target of its CNAME. For example, if l.trolltech.com is a CNAME to lupinella.troll.no, and the search path for QDns is "trolltech.com", then the canonical name for all of "lupinella", "l", "lupinella.troll.no." and "l.trolltech.com" is "lupinella.troll.no."..SH "QStringList QDns::hostNames () const"Returns a list of host names if the record type is \fCPtr.\fR.SH "bool QDns::isWorking () const"Returns TRUE if QDns is doing a lookup for this object, and FALSE if this object has the information it wants..PPQDns emits the resultsReady() signal when the status changes to FALSE..SH "QString QDns::label () const"Returns the domain name for which this object returns information..PPSee also setLabel()..SH "QValueList<MailServer> QDns::mailServers () const"Returns a list of mail servers if the record type is \fCMx.\fR The struct \fCQDns::MailServer\fR contains the following variables:.TP\fCQString\fR QDns::MailServer::name.TP\fCQ_UINT16\fR QDns::MailServer::priority.SH "QStringList QDns::qualifiedNames () const"Returns a list of the fully qualified names label() maps to..SH "QDns::RecordType QDns::recordType() const"Returns the record type of this query object..PPSee also setRecordType() and RecordType..SH "void QDns::resultsReady () \fC[signal]\fR"This signal is emitted when results are available for one of the qualifiedNames()..SH "QValueList<Server> QDns::servers () const"Returns a list of servers if the record type is \fCSrv.\fR The struct \fCQDns::Server\fR contains the following variables:.TP\fCQString\fR QDns::Server::name.TP\fCQ_UINT16\fR QDns::Server::priority.TP\fCQ_UINT16\fR QDns::Server::weight.TP\fCQ_UINT16\fR QDns::Server::port.SH "void QDns::setLabel ( const QHostAddress & address ) \fC[virtual]\fR"Sets this query object to query for information about the address \fIaddress.\fR The label is set to the IN-ADDR.ARPA domain name. This is useful in combination with the Ptr record type (i.e. if you want to look up a hostname for a given address..PPThis does not change the recordType(), but its isWorking() most likely changes as a result..PPThe DNS lookup is started the next time the application enters the event loop. When the result is found the signal resultsReady() is emmitted..SH "void QDns::setLabel ( const QString & label ) \fC[virtual]\fR"Sets this query object to query for information about \fIlabel.\fR.PPThis does not change the recordType(), but its isWorking() most likely changes as a result..PPThe DNS lookup is started the next time the application enters the event loop. When the result is found the signal resultsReady() is emmitted..SH "void QDns::setRecordType ( RecordType rr = A )"Sets this object to query for \fIrr\fR records..PPThe DNS lookup is started the next time the application enters the event loop. When the result is found the signal resultsReady() is emmitted..PPSee also RecordType..SH "QStringList QDns::texts () const"Returns a list of texts if the record type is \fCTxt.\fR.SH "SEE ALSO".BR http://doc.trolltech.com/qdns.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -