Browse Source

failed to commit the updated header file

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1063 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya 15 years ago
parent
commit
f65e4c2a73
1 changed files with 13 additions and 1 deletions
  1. 13 1
      src/lib/dns/cpp/message.h

+ 13 - 1
src/lib/dns/cpp/message.h

@@ -280,6 +280,7 @@ Opcode::RESERVED15()
 
 class Rcode {
 public:
+    Rcode(uint16_t code);
     uint16_t getCode() const { return (code_); }
     bool operator==(const Rcode& other) const { return (code_ == other.code_); }
     std::string toText() const;
@@ -299,9 +300,13 @@ public:
     static const Rcode& RESERVED13();
     static const Rcode& RESERVED14();
     static const Rcode& RESERVED15();
+    // Extended Rcodes follow (EDNS required)
+    static const Rcode& BADVERS();
 private:
-    Rcode(uint16_t code) : code_(code) {}
     uint16_t code_;
+
+    // EDNS-extended RCODEs are 12-bit unsigned integers.
+    static const uint16_t MAX_RCODE = 0xfff;
 };
 
 inline const Rcode&
@@ -416,6 +421,13 @@ Rcode::RESERVED15()
     return (c);
 }
 
+inline const Rcode&
+Rcode::BADVERS()
+{
+    static Rcode c(16);
+    return (c);
+}
+
 class Section {
 public:
     /// \brief Returns the relative position of the \c Section in DNS messages.