("Err#12")
("Err#13")
("Err#14")
- ("Err#15")
+ ("Err#15") // Last non-extended RCode
("Bad OPT Version / TSIG Signature Failure")
("Key not recognized")
("Signature out of time window")
("Duplicate key name")
("Algorithm not supported")
("Bad Truncation")
+ ("Bad/missing Server Cookie")
;
-std::string RCode::to_s(unsigned short rcode) {
- if (rcode > RCode::rcodes_s.size()-1 )
+std::string RCode::to_s(uint8_t rcode) {
+ if (rcode > 0xF)
+ return std::string("ErrOutOfRange");
+ return ERCode::to_s(rcode);
+}
+
+std::string ERCode::to_s(uint8_t rcode) {
+ if (rcode > RCode::rcodes_s.size()-1)
return std::string("Err#")+std::to_string(rcode);
return RCode::rcodes_s[rcode];
}
}
return str;
}
-
-vector<DNSResourceRecord> convertRRS(const vector<DNSRecord>& in)
-{
- vector<DNSResourceRecord> out;
- for(const auto& d : in) {
- DNSResourceRecord rr;
- rr.qname = d.d_name;
- rr.qtype = QType(d.d_type);
- rr.ttl = d.d_ttl;
- rr.content = d.d_content->getZoneRepresentation();
- rr.auth = false;
- rr.qclass = d.d_class;
- out.push_back(rr);
- }
- return out;
-}