From: Bert Hubert Date: Sun, 30 Jan 2011 19:52:05 +0000 (+0000) Subject: the wonderful #powerdns channel on irc.oftc.net discovered that powerdns could not... X-Git-Tag: auth-3.0~311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b55f2f549ed21662820ff6a877e430014b3ac22;p=thirdparty%2Fpdns.git the wonderful #powerdns channel on irc.oftc.net discovered that powerdns could not deal with record types > 2^15 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 --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index a7f056525a..b91b06f568 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -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); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index c0b2089dfa..163a3aeee0 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -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: diff --git a/pdns/qtype.cc b/pdns/qtype.cc index d81ba817d0..b6c5ebd445 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -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; diff --git a/pdns/qtype.hh b/pdns/qtype.hh index 9e54fc14ba..46ec6eba9d 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -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 namenum; + SPF=99, TSIG=250, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types; + typedef pair namenum; static vector names; private: - short int code; + uint16_t code; void insert(const char *p, int n);