From: JINMEI Tatuya Date: Wed, 22 May 2013 18:24:57 +0000 (-0700) Subject: [2905] preserved existing ZoneNode flag values for ZoneData. X-Git-Tag: bind10-1.2.0beta1-release~434^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f34eec70bf82d42c27a0df4709b0682abf2f7b2a;p=thirdparty%2Fkea.git [2905] preserved existing ZoneNode flag values for ZoneData. added a note on the numbering. and made one piggyback cleanup: define public static const explicitly. --- diff --git a/src/lib/datasrc/memory/zone_data.cc b/src/lib/datasrc/memory/zone_data.cc index a1d3430e92..cdcb683bf0 100644 --- a/src/lib/datasrc/memory/zone_data.cc +++ b/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, diff --git a/src/lib/datasrc/memory/zone_data.h b/src/lib/datasrc/memory/zone_data.h index 4d717714ab..b4c65f70fc 100644 --- a/src/lib/datasrc/memory/zone_data.h +++ b/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.