~ubuntu-branches/ubuntu/precise/pdns-recursor/precise

« back to all changes in this revision

Viewing changes to dnsrecords.hh

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Möhlmann
  • Date: 2011-01-22 16:39:02 UTC
  • mfrom: (1.1.8 upstream) (4.2.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110122163902-5549ul164u0yeoge
Tags: 3.3-1
* New upstream release. (Closes: #565052)
* Init loop is fixed in pdns (Closes: #594805)
* Now my name is spelled correctly.
* Update Standards-Version to 3.9.1
* Update the recursor.conf and include new configuration parameters.
* Add debug package (Closes: #594243)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    PowerDNS Versatile Database Driven Nameserver
3
 
    Copyright (C) 2005 - 2007  PowerDNS.COM BV
 
3
    Copyright (C) 2005 - 2010  PowerDNS.COM BV
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License version 2 as 
24
24
#include "rcpgenerator.hh"
25
25
#include <boost/lexical_cast.hpp>
26
26
#include <set>
 
27
#include <bitset>
27
28
 
28
29
using namespace std;
29
30
#include "namespaces.hh"
227
228
class DNSKEYRecordContent : public DNSRecordContent
228
229
{
229
230
public:
 
231
  DNSKEYRecordContent();
230
232
  includeboilerplate(DNSKEY)
 
233
  uint16_t getTag();
 
234
  string getExponent() const;
 
235
  string getModulus() const;
231
236
 
232
 
private:
233
237
  uint16_t d_flags;
234
238
  uint8_t d_protocol;
235
239
  uint8_t d_algorithm;
236
240
  string d_key;
 
241
private:
 
242
  void getExpLen(uint16_t& startPos, uint16_t& expLen) const;
237
243
};
238
244
 
239
245
class DSRecordContent : public DNSRecordContent
240
246
{
241
247
public:
 
248
  DSRecordContent();
242
249
  includeboilerplate(DS)
243
250
 
244
 
private:
245
251
  uint16_t d_tag;
246
252
  uint8_t d_algorithm, d_digesttype;
247
253
  string d_digest;
293
299
class RRSIGRecordContent : public DNSRecordContent
294
300
{
295
301
public:
 
302
  RRSIGRecordContent(); 
296
303
  includeboilerplate(RRSIG)
297
304
 
298
 
private:
299
305
  uint16_t d_type;
300
306
  uint8_t d_algorithm, d_labels;
301
307
  uint32_t d_originalttl, d_sigexpire, d_siginception;
328
334
  struct soatimes d_st;
329
335
};
330
336
 
331
 
class HIPRecordContent : public DNSRecordContent
332
 
{
333
 
public:
334
 
  includeboilerplate(HIP)
335
 
  HIPRecordContent(uint8_t algorithm, const string& hit, const string& key);
336
 
};
337
 
 
338
 
 
339
337
class NSECRecordContent : public DNSRecordContent
340
338
{
341
339
public:
353
351
private:
354
352
};
355
353
 
 
354
class NSEC3RecordContent : public DNSRecordContent
 
355
{
 
356
public:
 
357
  static void report(void);
 
358
  NSEC3RecordContent() : DNSRecordContent(50)
 
359
  {}
 
360
  NSEC3RecordContent(const string& content, const string& zone="");
 
361
 
 
362
  static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
 
363
  static DNSRecordContent* make(const string& content);
 
364
  string getZoneRepresentation() const;
 
365
  void toPacket(DNSPacketWriter& pw);
 
366
 
 
367
  uint8_t d_algorithm, d_flags;
 
368
  uint16_t d_iterations;
 
369
  uint8_t d_saltlength;
 
370
  string d_salt;
 
371
  uint8_t d_nexthashlength;
 
372
  string d_nexthash;
 
373
  std::set<uint16_t> d_set;
 
374
 
 
375
private:
 
376
};
 
377
 
 
378
 
 
379
class NSEC3PARAMRecordContent : public DNSRecordContent
 
380
{
 
381
public:
 
382
  static void report(void);
 
383
  NSEC3PARAMRecordContent() : DNSRecordContent(51)
 
384
  {}
 
385
  NSEC3PARAMRecordContent(const string& content, const string& zone="");
 
386
 
 
387
  static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
 
388
  static DNSRecordContent* make(const string& content);
 
389
  string getZoneRepresentation() const;
 
390
  void toPacket(DNSPacketWriter& pw);
 
391
 
 
392
 
 
393
  uint8_t d_algorithm, d_flags;
 
394
  uint16_t d_iterations;
 
395
  uint8_t d_saltlength;
 
396
  string d_salt;
 
397
};
 
398
 
 
399
 
356
400
class LOCRecordContent : public DNSRecordContent
357
401
{
358
402
public:
372
416
private:
373
417
};
374
418
 
 
419
 
 
420
class WKSRecordContent : public DNSRecordContent
 
421
{
 
422
public:
 
423
  static void report(void);
 
424
  WKSRecordContent() : DNSRecordContent(ns_t_wks)
 
425
  {}
 
426
  WKSRecordContent(const string& content, const string& zone="");
 
427
 
 
428
  static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
 
429
  static DNSRecordContent* make(const string& content);
 
430
  string getZoneRepresentation() const;
 
431
  void toPacket(DNSPacketWriter& pw);
 
432
 
 
433
  uint32_t d_ip;
 
434
  std::bitset<65535> d_services;
 
435
private:
 
436
};
 
437
 
 
438
 
375
439
class URLRecordContent : public DNSRecordContent // Fake, 'fancy record' with type 256
376
440
{
377
441
public: