/usr/include/jdns/qjdns.h is in libjdns-dev 2.0.3-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /*
* Copyright (C) 2005,2006 Justin Karneges
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// this is the Qt wrapper to jdns. it requires Qt 4.1+
#ifndef QJDNS_H
#define QJDNS_H
#include "jdns_export.h"
#include <QtCore>
#include <QtNetwork>
class JDNS_EXPORT QJDns : public QObject
{
Q_OBJECT
public:
enum Mode
{
Unicast,
Multicast
};
enum PublishMode
{
Unique,
Shared
};
enum Type
{
A = 1,
Aaaa = 28,
Mx = 15,
Srv = 33,
Cname = 5,
Ptr = 12,
Txt = 16,
Hinfo = 13,
Ns = 2,
Any = 255
};
enum Error
{
ErrorGeneric,
ErrorNXDomain, // query only
ErrorTimeout, // query only
ErrorConflict // publish only
};
class JDNS_EXPORT NameServer
{
public:
QHostAddress address;
int port;
NameServer();
};
class JDNS_EXPORT DnsHost
{
public:
QByteArray name;
QHostAddress address;
};
class JDNS_EXPORT SystemInfo
{
public:
QList<NameServer> nameServers;
QList<QByteArray> domains;
QList<DnsHost> hosts;
};
class JDNS_EXPORT Record
{
public:
QByteArray owner;
int ttl;
int type;
QByteArray rdata;
bool haveKnown;
// known
QHostAddress address; // for A, Aaaa
QByteArray name; // for Mx, Srv, Cname, Ptr, Ns
int priority; // for Mx, Srv
int weight; // for Srv
int port; // for Srv
QList<QByteArray> texts; // for Txt
QByteArray cpu; // for Hinfo
QByteArray os; // for Hinfo
Record();
bool verify() const;
};
class JDNS_EXPORT Response
{
public:
QList<Record> answerRecords;
QList<Record> authorityRecords;
QList<Record> additionalRecords;
};
QJDns(QObject *parent = 0);
~QJDns();
bool init(Mode mode, const QHostAddress &address);
void shutdown();
QStringList debugLines();
static SystemInfo systemInfo();
static QHostAddress detectPrimaryMulticast(const QHostAddress &address);
void setNameServers(const QList<NameServer> &list);
int queryStart(const QByteArray &name, int type);
void queryCancel(int id);
// for multicast mode only
int publishStart(PublishMode m, const Record &record);
void publishUpdate(int id, const Record &record);
void publishCancel(int id);
signals:
void resultsReady(int id, const QJDns::Response &results);
void published(int id);
void error(int id, QJDns::Error e);
void shutdownFinished();
void debugLinesReady();
private:
class Private;
friend class Private;
Private *d;
};
#endif
|