Permalink
Browse files

Implement TKEY record type

  • Loading branch information...
1 parent 0b7e766 commit cd3f21c60a3179e5eea5ac969684fd6d4484e976 @cmouse cmouse committed with cmouse Feb 18, 2015
Showing with 34 additions and 1 deletion.
  1. +13 −0 pdns/dnsrecords.cc
  2. +19 −0 pdns/dnsrecords.hh
  3. +2 −1 pdns/qtype.hh
View
@@ -424,6 +424,18 @@ string EUI64RecordContent::getZoneRepresentation() const
/* EUI64 end */
+boilerplate_conv(TKEY, QType::TKEY,
+ conv.xfrLabel(d_algo);
+ conv.xfr32BitInt(d_inception);
+ conv.xfr32BitInt(d_expiration);
+ conv.xfr16BitInt(d_mode);
+ conv.xfr16BitInt(d_error);
+ conv.xfr16BitInt(d_keysize);
+ if (d_keysize>0) conv.xfrBlobNoSpaces(d_key, d_keysize);
+ conv.xfr16BitInt(d_othersize);
+ if (d_othersize>0) conv.xfrBlobNoSpaces(d_other, d_othersize);
+ )
+TKEYRecordContent::TKEYRecordContent() : DNSRecordContent(QType::TKEY) {}
uint16_t DNSKEYRecordContent::getTag()
{
@@ -515,6 +527,7 @@ void reportOtherTypes()
TLSARecordContent::report();
DLVRecordContent::report();
DNSRecordContent::regist(QClass::ANY, QType::TSIG, &TSIGRecordContent::make, &TSIGRecordContent::make, "TSIG");
+ DNSRecordContent::regist(QClass::ANY, QType::TKEY, &TKEYRecordContent::make, &TKEYRecordContent::make, "TKEY");
//TSIGRecordContent::report();
OPTRecordContent::report();
EUI48RecordContent::report();
View
@@ -542,6 +542,25 @@ private:
uint8_t d_eui64[8];
};
+class TKEYRecordContent : public DNSRecordContent
+{
+public:
+ TKEYRecordContent();
+ includeboilerplate(TKEY)
+
+ // storage for the bytes
+ string d_algo;
+ uint32_t d_inception;
+ uint32_t d_expiration;
+ uint16_t d_mode;
+ uint16_t d_error;
+ uint16_t d_keysize;
+ string d_key;
+ uint16_t d_othersize;
+ string d_other;
+private:
+};
+
#define boilerplate(RNAME, RTYPE) \
RNAME##RecordContent::DNSRecordContent* RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \
{ \
View
@@ -82,7 +82,7 @@ public:
#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, SIG=24, KEY=25, AAAA=28, LOC=29, SRV=33, NAPTR=35, KX=36,
CERT=37, A6=38, DNAME=39, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
- TLSA=52, SPF=99, EUI48=108, EUI64=109, TSIG=250, IXFR=251, AXFR=252, MAILB=253, MAILA=254, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
+ TLSA=52, SPF=99, EUI48=108, EUI64=109, TKEY=249, TSIG=250, IXFR=251, AXFR=252, MAILB=253, MAILA=254, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
typedef pair<string,uint16_t> namenum;
static vector<namenum> names;
@@ -156,6 +156,7 @@ private:
qtype_insert("SPF", 99);
qtype_insert("EUI48", 108);
qtype_insert("EUI64", 109);
+ qtype_insert("TKEY", 249);
// qtype_insert("TSIG", 250);
qtype_insert("IXFR", 251);
qtype_insert("AXFR", 252);

0 comments on commit cd3f21c

Please sign in to comment.