Browse Source

[2905] preserved existing ZoneNode flag values for ZoneData.

added a note on the numbering.
and made one piggyback cleanup: define public static const explicitly.
JINMEI Tatuya 12 years ago
parent
commit
f34eec70bf
2 changed files with 15 additions and 6 deletions
  1. 4 0
      src/lib/datasrc/memory/zone_data.cc
  2. 11 6
      src/lib/datasrc/memory/zone_data.h

+ 4 - 0
src/lib/datasrc/memory/zone_data.cc

@@ -38,6 +38,10 @@ namespace isc {
 namespace datasrc {
 namespace memory {
 
+// Definition of a class static constant.  It's public and its address
+// could be needed by applications, so we need an explicit definition.
+const ZoneNode::Flags ZoneData::DNSSEC_SIGNED;
+
 namespace {
 void
 rdataSetDeleter(RRClass rrclass, util::MemorySegment* mem_sgmt,

+ 11 - 6
src/lib/datasrc/memory/zone_data.h

@@ -378,22 +378,27 @@ private:
     /// It never throws an exception.
     ZoneData(ZoneTree* zone_tree, ZoneNode* origin_node);
 
-    // Zone node flags.
+    // Zone node flags.  When adding a new flag, it's generally advisable to
+    // keep existing values so the binary image of the data is as much
+    // backward compatible as possible.  And it can be helpful in practice
+    // for file-mapped data.
 private:
     // Set in the origin node (which always exists at the same address)
     // to indicate whether the zone is signed or not.  Internal use,
     // so defined as private.
     static const ZoneNode::Flags DNSSEC_SIGNED = ZoneNode::FLAG_USER1;
 
-    // Also set in the origin node, indicating this is a special "empty zone",
-    // that could be created only by the corresponding create() method to be
-    // used for some kind of sentinel data.
-    static const ZoneNode::Flags EMPTY_ZONE = ZoneNode::FLAG_USER2;
 public:
     /// \brief Node flag indicating it is at a "wildcard level"
     ///
     /// This means one of the node's immediate children is a wildcard.
-    static const ZoneNode::Flags WILDCARD_NODE = ZoneNode::FLAG_USER3;
+    static const ZoneNode::Flags WILDCARD_NODE = ZoneNode::FLAG_USER2;
+
+private:
+    // Also set in the origin node, indicating this is a special "empty zone",
+    // that could be created only by the corresponding create() method to be
+    // used for some kind of sentinel data.
+    static const ZoneNode::Flags EMPTY_ZONE = ZoneNode::FLAG_USER3;
 
 public:
     /// \brief Allocate and construct \c ZoneData.