/usr/include/rds/server/rdsdnszone.h is in librdsserver-dev 1.1.0-0ubuntu1.
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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | /***************************************************************************
* Copyright (C) 2011 by Resara LLC *
* brendan@resara.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************/
#ifndef RDSDNSZONE_H
#define RDSDNSZONE_H
#include <QxtPimpl>
#include <QString>
#include <QMetaType>
#include <QStringList>
#include <QHash>
#include <ReturnValue>
#include <ServiceProxy>
class RdsDnsZonePrivate;
class RdsDnsManager;
class RdsDnsRecord;
/**
@author Chris Vickery <chris@resara.com>
*/
class RdsDnsZone : public QtRpc::ServiceProxy
{
Q_OBJECT;
QXT_DECLARE_PRIVATE(RdsDnsZone);
QTRPC_SERVICEPROXY_PIMPL(RdsDnsZone);
friend class RdsDnsManager;
public:
/// IMPORTANT! This is copied on the client side, too. Keep them synced plox!
enum RecordType
{
Invalid,
A,
AAAA,
AFSDB,
CERT,
CNAME,
DHCID,
DLV,
DNAME,
DNSKEY,
DS,
HIP,
IPSECKEY,
KEY,
LOC,
MX,
NAPTR,
NS,
NSEC,
NSEC3,
NSEC3PARAM,
PTR,
RRSIG,
SIG,
SOA,
SPF,
SRV,
SSHFP,
TA,
TXT
};
static QString typeToString(RecordType type);
static RecordType stringToType(const QString& type);
protected:
RdsDnsZone(RdsDnsManager* mgr);
public:
RdsDnsZone();
RdsDnsZone(const RdsDnsZone& other);
~RdsDnsZone();
RdsDnsZone& operator=(const RdsDnsZone& other);
public slots:
/**
* Parses a zone file
* @param config the zone file to parse
* @return true. Check isValid() and errorString() for errors.
*/
ReturnValue parse(const QString &config);
/**
* Gets the currently loaded zone file.
* @return QString on success, error on failure.
*/
ReturnValue toString() const;
/**
* Saves the current zone information to a file
* @return true on success, error on failure.
*/
ReturnValue save();
/**
* Gets the domain name for the zone
* @return domain name as a QString
*/
ReturnValue domainName() const;
/**
* Sets the Domain Name for the zone
* @param domainName the domain name
* @return true
*/
ReturnValue setDomainName(const QString &domainName);
/**
* Gets the name of the primary name server
* @return returns the server name as a QString
*/
ReturnValue primaryNameServer() const;
/**
* Sets the name of the primary name server for the zone
* @param primaryNameServer name of the name server
* @return true
*/
ReturnValue setPrimaryNameServer(const QString &primaryNameServer); //must also have a host entry if it's not an IP, which it shouldn't be
/**
* Gets the name of the administrator name server
* @return the server name as a QString
*/
ReturnValue adminNameServer() const;
/**
* Sets the name of the administrator name server for the zone
* @param ns the name of the admininstrator name server
* @return true
*/
ReturnValue setAdminNameServer(const QString &ns);
/**
* Gets a the SOA values for the zone
* @return QVariantList of SOA vlaues
*/
ReturnValue soaValues() const;
/**
* Sets the SOA values for the zone. Must be 5 values in the list to be valid.
* @param values a list of the SOA values
* @return true
*/
ReturnValue setSoaValues(const QStringList &values);
/**
* Adds a resource record to the zone with the default origin and tty
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value the value of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QString &value);
/**
* Adds a resource record to the zone with the default tty
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value the value of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QString &value, const QString &origin);
/**
* Adds a resource record to the zone, ttl is not matched when checking if it should replace an existing record
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value the value of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QString &value, const QString &origin, const QString &ttl);
/**
* Adds a resource record to the zone with the default origin and tty
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value list of values of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QStringList &value);
/**
* Adds a resource record to the zone with the default tty
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value list of values of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QStringList &value, const QString &origin);
/**
* Adds a resource record to the zone, ttl is not matched when checking if it should replace an existing record
* @param type the resource record type (NS, A, CNAME,...)
* @param key the key to identify the RR
* @param value list of values of the RR
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(int type, const QString &key, const QStringList &value, const QString &origin, const QString &ttl);
/**
* Adds a resource record to the zone (ignores comments)
* @param record the record to add
* @return true if a new record was added, false if it replaced an existing record
*/
ReturnValue addRecord(const RdsDnsRecord &record); //return value is if it replaced or not
/**
* Removes a record from the zone
* @param type the type of record being removed
* @param key the key of the record to remove
* @return true if the record was removed, false if not (record did not exist)
*/
ReturnValue removeRecord(int type, const QString &key); //return value is if it existed or not
/**
* Removes a record from the zone
* @param type the type of record being removed
* @param key the key of the record to remove
* @return true if the record was removed, false if not (record did not exist)
*/
ReturnValue removeRecord(int type, const QString &key, const QString &origin); //return value is if it existed or not
/**
* Removes a record from the zone
* @param record The record to remove
* @return true if the record was removed, false if not (record did not exist)
*/
ReturnValue removeRecord(const RdsDnsRecord &record); //return value is if it existed or not
/**
* Gets a resource record from the zone
* @param type the type of record to get
* @param key the key of the desired record
* @return returns a DnsRecord of the record, if the record was not found the type will be RdsDnsZone::Invalid
*/
ReturnValue record(int type, const QString &key) const;
/**
* Gets a resource record from the zone
* @param type the type of record to get
* @param key the key of the desired record
* @return returns a DnsRecord of the record, if the record was not found the type will be RdsDnsZone::Invalid
*/
ReturnValue record(int type, const QString &key, const QString &origin) const;
/**
* Gets a resource record from the zone
* @param type the type of record to get
* @param key the key of the desired record
* @return returns a DnsRecordList of the matching records
*/
ReturnValue records(int type, const QString &key) const;
/**
* Gets a resource record from the zone
* @param type the type of record to get
* @param key the key of the desired record
* @return returns a DnsRecordList of the matching records
*/
ReturnValue records(int type, const QString &key, const QString &origin) const;
/**
* Gets a list of all the records from the zone
* @return DnsRecordList
*/
ReturnValue listRecords() const;
/**
* Gets a list of records with the specified type
* @param type the type of records to get
* @return DnsRecordList
*/
ReturnValue listRecordsByType(int type) const;
/**
* Gets a list of records with the specified key
* @param key the key of the desired records
* @return DnsRecordList
*/
ReturnValue listRecordsByKey(const QString &key) const;
/**
* Gets a list of records with the specified origin value
* @param origin the origin of the records to list
* @return RdsDnsRecordList
*/
ReturnValue listRecordsByOrigin(const QString &origin) const;
/**
* TODO fix so it actually returns things...
* @param root
* @return QStringList
*/
ReturnValue listOrigins(const QString &root) const;
/**
*
* @return QStringList
*/
ReturnValue listOrigins() const;
/**
* checks the validity of the zone
* @return true if valid, false if not
*/
ReturnValue isValid() const;
/**
* Gets the Error String
* @return QString
*/
ReturnValue errorString() const;
ReturnValue addOrigin(const QString &origin);
ReturnValue removeOrigin(const QString &origin);
ReturnValue renameOrigin(const QString &oldname, const QString &newname);
private slots:
void removed();
};
Q_DECLARE_METATYPE(RdsDnsZone);
#endif
|