2 * Copyright (C) 2005,2006 Justin Karneges
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 // this is the Qt wrapper to jdns. it requires Qt 4.1+
32 class QJDns
: public QObject
65 ErrorNXDomain
, // query only
66 ErrorTimeout
, // query only
67 ErrorConflict
// publish only
89 QList
<NameServer
> nameServers
;
90 QList
<QByteArray
> domains
;
104 QHostAddress address
; // for A, Aaaa
105 QByteArray name
; // for Mx, Srv, Cname, Ptr, Ns
106 int priority
; // for Mx, Srv
107 int weight
; // for Srv
109 QList
<QByteArray
> texts
; // for Txt
110 QByteArray cpu
; // for Hinfo
111 QByteArray os
; // for Hinfo
120 QList
<Record
> answerRecords
;
121 QList
<Record
> authorityRecords
;
122 QList
<Record
> additionalRecords
;
125 QJDns(QObject
*parent
= 0);
128 bool init(Mode mode
, const QHostAddress
&address
);
130 QStringList
debugLines();
132 static SystemInfo
systemInfo();
133 static QHostAddress
detectPrimaryMulticast(const QHostAddress
&address
);
135 void setNameServers(const QList
<NameServer
> &list
);
137 int queryStart(const QByteArray
&name
, int type
);
138 void queryCancel(int id
);
140 // for multicast mode only
141 int publishStart(PublishMode m
, const Record
&record
);
142 void publishUpdate(int id
, const Record
&record
);
143 void publishCancel(int id
);
146 void resultsReady(int id
, const QJDns::Response
&results
);
147 void published(int id
);
148 void error(int id
, QJDns::Error e
);
149 void shutdownFinished();
150 void debugLinesReady();
154 friend class Private
;