]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/dns.cc
auth: switch circleci mssql image
[thirdparty/pdns.git] / pdns / dns.cc
index 727a4a9f0be6f9f34cbf40296b4475474def8c38..5d40735649236b038c5c53b38812d0d94d6b5363 100644 (file)
@@ -46,7 +46,7 @@ std::vector<std::string> RCode::rcodes_s = boost::assign::list_of
   ("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")
@@ -54,10 +54,17 @@ std::vector<std::string> RCode::rcodes_s = boost::assign::list_of
   ("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];
 }
@@ -123,19 +130,3 @@ string& attodot(string &str)
    }
    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;
-}