]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
the wonderful #powerdns channel on irc.oftc.net discovered that powerdns could not...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 30 Jan 2011 19:52:05 +0000 (19:52 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 30 Jan 2011 19:52:05 +0000 (19:52 +0000)
Fixed that. Plus fixed what caused the issue, the DLV record type, which is now supported too (at least for storage). Closes ticket 337.

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1936 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/qtype.cc
pdns/qtype.hh

index a7f056525ade23f0d733711aa31a9e33c0d0d5c3..b91b06f568dfda28088358bde09e090cd1ad9561 100644 (file)
@@ -230,6 +230,15 @@ boilerplate_conv(DS, 43,
                 conv.xfrHexBlob(d_digest, true); // keep reading across spaces
                 )
 
+DLVRecordContent::DLVRecordContent() : DNSRecordContent(32769) {}
+boilerplate_conv(DLV,32769 , 
+                conv.xfr16BitInt(d_tag); 
+                conv.xfr8BitInt(d_algorithm); 
+                conv.xfr8BitInt(d_digesttype); 
+                conv.xfrHexBlob(d_digest, true); // keep reading across spaces
+                )
+
+
 boilerplate_conv(SSHFP, 44, 
                 conv.xfr8BitInt(d_algorithm); 
                 conv.xfr8BitInt(d_fptype); 
index c0b2089dfa94249ded5537ebb6961ea33b90090f..163a3aeee076889d819a7582fb1955fdc55d4f6c 100644 (file)
@@ -249,6 +249,18 @@ public:
   string d_digest;
 };
 
+class DLVRecordContent : public DNSRecordContent
+{
+public:
+  DLVRecordContent();
+  includeboilerplate(DLV)
+
+  uint16_t d_tag;
+  uint8_t d_algorithm, d_digesttype;
+  string d_digest;
+};
+
+
 class SSHFPRecordContent : public DNSRecordContent
 {
 public:
index d81ba817d0955a88024d3ddcb8a47a37133d251d..b6c5ebd445faaf295291e2b18ea4a14f0f80cdbd 100644 (file)
@@ -74,10 +74,11 @@ QType::QType()
       insert("MBOXFW",257);
       insert("CURL",258);
       insert("ADDR",259);
+      insert("DLV",32769);
     }
 }
 
-int QType::getCode() const
+uint16_t QType::getCode() const
 {
   return code;
 }
@@ -92,7 +93,7 @@ const string QType::getName() const
   return "#"+itoa(code);
 }
 
-QType &QType::operator=(int n)
+QType &QType::operator=(uint16_t n)
 {
   code=n;
   return *this;
@@ -127,7 +128,7 @@ QType &QType::operator=(const string &s)
 }
 
 
-QType::QType(int n)
+QType::QType(uint16_t n)
 {
   QType();
   code=n;
index 9e54fc14ba590c55f0cd64c25fc0488dd67cdd1d..46ec6eba9db00394540d0d62598f99d7172f8476 100644 (file)
@@ -46,12 +46,12 @@ class QType
 {
 public:
   QType(); //!< Naked constructor
-  explicit QType(int); //!< convert from an integer to a QType
+  explicit QType(uint16_t); //!< convert from an integer to a QType
   QType(const char *p);  //!< convert from a char* to a QType
   QType(const QType& orig) : code(orig.code)
   {
   }
-  QType &operator=(int);  //!< Assigns integers to us
+  QType &operator=(uint16_t);  //!< Assigns integers to us
   QType &operator=(const char *); //!< Assings strings to us
   QType &operator=(const string &); //!< Assings strings to us
   QType &operator=(const QType&rhs)  //!< Assings strings to us
@@ -68,18 +68,18 @@ public:
   bool operator==(const QType &) const; //!< equality operator
 
   const string getName() const; //!< Get a string representation of this type
-  int getCode() const; //!< Get the integer representation of this type
+  uint16_t getCode() const; //!< Get the integer representation of this type
 
   static int chartocode(const char *p); //!< convert a character string to a code
 // more solaris fun
 #undef DS   
   enum typeenum {A=1,NS=2,CNAME=5,SOA=6, MR=9, PTR=12,HINFO=13,MX=15,TXT=16,RP=17,AFSDB=18,KEY=25,AAAA=28,LOC=29,SRV=33,NAPTR=35, KX=36, 
                 CERT=37,OPT=41, DS=43, SSHDP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
-                SPF=99, TSIG=250, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259} types;
-  typedef pair<string,int> namenum; 
+                SPF=99, TSIG=250, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
+  typedef pair<string,uint16_t> namenum; 
   static vector<namenum> names;
 private:
-  short int code;
+  uint16_t code;
   void insert(const char *p, int n);