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+
29
#include "jdns_export.h"
33
class JDNS_EXPORT QJDns : public QObject
66
ErrorNXDomain, // query only
67
ErrorTimeout, // query only
68
ErrorConflict // publish only
71
class JDNS_EXPORT NameServer
80
class JDNS_EXPORT DnsHost
87
class JDNS_EXPORT SystemInfo
90
QList<NameServer> nameServers;
91
QList<QByteArray> domains;
95
class JDNS_EXPORT Record
105
QHostAddress address; // for A, Aaaa
106
QByteArray name; // for Mx, Srv, Cname, Ptr, Ns
107
int priority; // for Mx, Srv
108
int weight; // for Srv
110
QList<QByteArray> texts; // for Txt
111
QByteArray cpu; // for Hinfo
112
QByteArray os; // for Hinfo
118
class JDNS_EXPORT Response
121
QList<Record> answerRecords;
122
QList<Record> authorityRecords;
123
QList<Record> additionalRecords;
126
QJDns(QObject *parent = 0);
129
bool init(Mode mode, const QHostAddress &address);
131
QStringList debugLines();
133
static SystemInfo systemInfo();
134
static QHostAddress detectPrimaryMulticast(const QHostAddress &address);
136
void setNameServers(const QList<NameServer> &list);
138
int queryStart(const QByteArray &name, int type);
139
void queryCancel(int id);
141
// for multicast mode only
142
int publishStart(PublishMode m, const Record &record);
143
void publishUpdate(int id, const Record &record);
144
void publishCancel(int id);
147
void resultsReady(int id, const QJDns::Response &results);
148
void published(int id);
149
void error(int id, QJDns::Error e);
150
void shutdownFinished();
151
void debugLinesReady();
155
friend class Private;