zone.h 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. // Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef __ZONE_H
  15. #define __ZONE_H 1
  16. #include <dns/name.h>
  17. #include <dns/rrset.h>
  18. #include <dns/rrtype.h>
  19. #include <datasrc/result.h>
  20. #include <utility>
  21. #include <vector>
  22. namespace isc {
  23. namespace datasrc {
  24. /// \brief Out of zone exception
  25. ///
  26. /// This is thrown when a method is called for a name or RRset which
  27. /// is not in or below the zone.
  28. class OutOfZone : public Exception {
  29. public:
  30. OutOfZone(const char* file, size_t line, const char* what) :
  31. isc::Exception(file, line, what) {}
  32. };
  33. /// \brief The base class to search a zone for RRsets
  34. ///
  35. /// The \c ZoneFinder class is an abstract base class for representing
  36. /// an object that performs DNS lookups in a specific zone accessible via
  37. /// a data source. In general, different types of data sources (in-memory,
  38. /// database-based, etc) define their own derived classes of \c ZoneFinder,
  39. /// implementing ways to retrieve the required data through the common
  40. /// interfaces declared in the base class. Each concrete \c ZoneFinder
  41. /// object is therefore (conceptually) associated with a specific zone
  42. /// of one specific data source instance.
  43. ///
  44. /// The origin name and the RR class of the associated zone are available
  45. /// via the \c getOrigin() and \c getClass() methods, respectively.
  46. ///
  47. /// The most important method of this class is \c find(), which performs
  48. /// the lookup for a given domain and type. See the description of the
  49. /// method for details.
  50. ///
  51. /// \note It's not clear whether we should request that a zone finder form a
  52. /// "transaction", that is, whether to ensure the finder is not susceptible
  53. /// to changes made by someone else than the creator of the finder. If we
  54. /// don't request that, for example, two different lookup results for the
  55. /// same name and type can be different if other threads or programs make
  56. /// updates to the zone between the lookups. We should revisit this point
  57. /// as we gain more experiences.
  58. class ZoneFinder {
  59. public:
  60. /// Result codes of the \c find() method.
  61. ///
  62. /// Note: the codes are tentative. We may need more, or we may find
  63. /// some of them unnecessary as we implement more details.
  64. ///
  65. /// See the description of \c find() for further details of how
  66. /// these results should be interpreted.
  67. enum Result {
  68. SUCCESS, ///< An exact match is found.
  69. DELEGATION, ///< The search encounters a zone cut.
  70. NXDOMAIN, ///< There is no domain name that matches the search name
  71. NXRRSET, ///< There is a matching name but no RRset of the search type
  72. CNAME, ///< The search encounters and returns a CNAME RR
  73. DNAME ///< The search encounters and returns a DNAME RR
  74. };
  75. /// Special attribute flags on the result of the \c find() method
  76. ///
  77. /// The flag values defined here are intended to signal to the caller
  78. /// that it may need special handling on the result. This is particularly
  79. /// of concern when DNSSEC is requested. For example, for negative
  80. /// responses the caller would want to know whether the zone is signed
  81. /// with NSEC or NSEC3 so that it can subsequently provide necessary
  82. /// proof of the result.
  83. ///
  84. /// The caller is generally expected to get access to the information
  85. /// via read-only getter methods of \c FindContext so that it won't rely
  86. /// on specific details of the representation of the flags. So these
  87. /// definitions are basically only meaningful for data source
  88. /// implementations.
  89. enum FindResultFlags {
  90. RESULT_DEFAULT = 0, ///< The default flags
  91. RESULT_WILDCARD = 1, ///< find() resulted in a wildcard match
  92. RESULT_NSEC_SIGNED = 2, ///< The zone is signed with NSEC RRs
  93. RESULT_NSEC3_SIGNED = 4 ///< The zone is signed with NSEC3 RRs
  94. };
  95. /// Find options.
  96. ///
  97. /// The option values are used as a parameter for \c find().
  98. /// These are values of a bitmask type. Bitwise operations can be
  99. /// performed on these values to express compound options.
  100. enum FindOptions {
  101. FIND_DEFAULT = 0, ///< The default options
  102. FIND_GLUE_OK = 1, ///< Allow search under a zone cut
  103. FIND_DNSSEC = 2, ///< Require DNSSEC data in the answer
  104. ///< (RRSIG, NSEC, etc.). The implementation
  105. ///< is allowed to include it even if it is
  106. ///< not set.
  107. NO_WILDCARD = 4 ///< Do not try wildcard matching.
  108. };
  109. protected:
  110. /// \brief A convenient tuple representing a set of find() results.
  111. ///
  112. /// This helper structure is specifically expected to be used as an input
  113. /// for the construct of the \c Context class object used by derived
  114. /// ZoneFinder implementations. This is therefore defined as protected.
  115. struct ResultContext {
  116. ResultContext(Result code_param,
  117. isc::dns::ConstRRsetPtr rrset_param,
  118. FindResultFlags flags_param = RESULT_DEFAULT) :
  119. code(code_param), rrset(rrset_param), flags(flags_param)
  120. {}
  121. const Result code;
  122. const isc::dns::ConstRRsetPtr rrset;
  123. const FindResultFlags flags;
  124. };
  125. public:
  126. /// \brief Context of the result of a find() call.
  127. ///
  128. /// This class encapsulates results and (possibly) associated context
  129. /// of a call to the \c find() method. The public member variables of
  130. /// this class reprsent the result of the call. They are a
  131. /// straightforward tuple of the result code and a pointer (and
  132. /// optionally special flags) to the found RRset.
  133. ///
  134. /// These member variables will be initialized on construction and never
  135. /// change, so for convenience we allow the applications to refer to some
  136. /// of the members directly. For some others we provide read-only accessor
  137. /// methods to hide specific representation.
  138. ///
  139. /// Another role of this class is to provide the interface to some common
  140. /// processing logic that may be necessary using the result of \c find().
  141. /// Specifically, it's expected to be used in the context of DNS query
  142. /// handling, where the caller would need to look into the data source
  143. /// again based on the \c find() result. For example, it would need to
  144. /// get A and/or AAAA records for some of the answer or authority RRs.
  145. ///
  146. /// This class defines (a set of) method(s) that can be commonly used
  147. /// for such purposes for any type of data source (as long as it conforms
  148. /// to the public \c find() interface). In some cases, a specific data
  149. /// source implementation may want to (and can) optimize the processing
  150. /// exploiting its internal data structure and the knowledge of the context
  151. /// of the precedent \c find() call. Such a data source implementation
  152. /// can define a derived class of the base Context and override the
  153. /// specific virtual method.
  154. ///
  155. /// This class object is generally expected to be associated with the
  156. /// ZoneFinder that originally performed the \c find() call, and expects
  157. /// the finder is valid throughout the lifetime of this object. It's
  158. /// caller's responsibility to ensure that assumption.
  159. class Context {
  160. public:
  161. /// \brief The constructor for the normal find call.
  162. ///
  163. /// This constructor is expected to be called from the \c find()
  164. /// method when it constructs the return value.
  165. ///
  166. /// \param finder The ZoneFinder on which find() is called.
  167. /// \param options The find options specified for the find() call.
  168. /// \param result The result of the find() call.
  169. Context(ZoneFinder& finder, FindOptions options,
  170. const ResultContext& result) :
  171. code(result.code), rrset(result.rrset),
  172. finder_(finder), flags_(result.flags), options_(options)
  173. {}
  174. /// \brief The constructor for the normal findAll call.
  175. ///
  176. /// This constructor is expected to be called from the \c findAll()
  177. /// method when it constructs the return value.
  178. ///
  179. /// It copies the vector that is to be returned to the caller of
  180. /// \c findAll() for possible subsequent use. Note that it cannot
  181. /// simply hold a reference to the vector because the caller may
  182. /// alter it after the \c findAll() call.
  183. ///
  184. /// \param finder The ZoneFinder on which findAll() is called.
  185. /// \param options The find options specified for the findAll() call.
  186. /// \param result The result of the findAll() call (whose rrset is
  187. /// expected to be NULL).
  188. /// \param all_set Reference to the vector given by the caller of
  189. /// \c findAll(), storing the RRsets to be returned.
  190. Context(ZoneFinder& finder, FindOptions options,
  191. const ResultContext& result,
  192. const std::vector<isc::dns::ConstRRsetPtr> &all_set) :
  193. code(result.code), rrset(result.rrset),
  194. finder_(finder), flags_(result.flags), options_(options),
  195. all_set_(all_set)
  196. {}
  197. /// \brief The destructor.
  198. virtual ~Context() {}
  199. const Result code;
  200. const isc::dns::ConstRRsetPtr rrset;
  201. /// Return true iff find() results in a wildcard match.
  202. bool isWildcard() const { return ((flags_ & RESULT_WILDCARD) != 0); }
  203. /// Return true when the underlying zone is signed with NSEC.
  204. ///
  205. /// The \c find() implementation allows this to return false if
  206. /// \c FIND_DNSSEC isn't specified regardless of whether the zone
  207. /// is signed or which of NSEC/NSEC3 is used.
  208. ///
  209. /// When this is returned, the implementation of find() must ensure
  210. /// that \c rrset be a valid NSEC RRset as described in \c find()
  211. /// documentation.
  212. bool isNSECSigned() const {
  213. return ((flags_ & RESULT_NSEC_SIGNED) != 0);
  214. }
  215. /// Return true when the underlying zone is signed with NSEC3.
  216. ///
  217. /// The \c find() implementation allows this to return false if
  218. /// \c FIND_DNSSEC isn't specified regardless of whether the zone
  219. /// is signed or which of NSEC/NSEC3 is used.
  220. bool isNSEC3Signed() const {
  221. return ((flags_ & RESULT_NSEC3_SIGNED) != 0);
  222. }
  223. /// \brief Find and return additional RRsets corresponding to the
  224. /// result of \c find().
  225. ///
  226. /// If this context is based on a normal find() call that resulted
  227. /// in SUCCESS or DELEGATION, it examines the returned RRset (in many
  228. /// cases NS, sometimes MX or others), searches the data source for
  229. /// specified type of additional RRs for each RDATA of the RRset
  230. /// (e.g., A or AAAA for the name server addresses), and stores the
  231. /// result in the given vector. The vector may not be empty; this
  232. /// method appends any found RRsets to it, without touching existing
  233. /// elements.
  234. ///
  235. /// If this context is based on a findAll() call that resulted in
  236. /// SUCCESS, it performs the same process for each RRset returned in
  237. /// the \c findAll() call.
  238. ///
  239. /// The caller specifies desired RR types of the additional RRsets
  240. /// in \c requested_types. Normally it consists of A and/or AAAA
  241. /// types, but other types can be specified.
  242. ///
  243. /// This method is meaningful only when the precedent find()/findAll()
  244. /// call resulted in SUCCESS or DELEGATION. Otherwise this method
  245. /// does nothing.
  246. ///
  247. /// \note The additional RRsets returned via method are limited to
  248. /// ones contained in the zone which the corresponding find/findAll
  249. /// call searched (possibly including glues under a zone cut where
  250. /// they are applicable). If the caller needs to get out-of-zone
  251. /// additional RRsets, it needs to explicitly finds them by
  252. /// identifying the corresponding zone and calls \c find() for it.
  253. ///
  254. /// \param requested_types A vector of RR types for desired additional
  255. /// RRsets.
  256. /// \param result A vector to which any found additional RRsets are
  257. /// to be inserted.
  258. void getAdditional(
  259. const std::vector<isc::dns::RRType>& requested_types,
  260. std::vector<isc::dns::ConstRRsetPtr>& result)
  261. {
  262. // Perform common checks, and delegate the process to the default
  263. // or specialized implementation.
  264. if (code != SUCCESS && code != DELEGATION) {
  265. return;
  266. }
  267. getAdditionalImpl(requested_types, result);
  268. }
  269. protected:
  270. /// \brief Actual implementation of getAdditional().
  271. ///
  272. /// This base class defines a default implementation that can be
  273. /// used for any type of data sources. A data source implementation
  274. /// can override it.
  275. virtual void getAdditionalImpl(
  276. const std::vector<isc::dns::RRType>& requested_types,
  277. std::vector<isc::dns::ConstRRsetPtr>& result);
  278. private:
  279. ZoneFinder& finder_;
  280. const FindResultFlags flags_;
  281. const FindOptions options_;
  282. std::vector<isc::dns::ConstRRsetPtr> all_set_;
  283. };
  284. ///
  285. /// \name Constructors and Destructor.
  286. ///
  287. //@{
  288. protected:
  289. /// The default constructor.
  290. ///
  291. /// This is intentionally defined as \c protected as this base class should
  292. /// never be instantiated (except as part of a derived class).
  293. ZoneFinder() {}
  294. public:
  295. /// The destructor.
  296. virtual ~ZoneFinder() {}
  297. //@}
  298. ///
  299. /// \name Getter Methods
  300. ///
  301. /// These methods should never throw an exception.
  302. //@{
  303. /// Return the origin name of the zone.
  304. virtual isc::dns::Name getOrigin() const = 0;
  305. /// Return the RR class of the zone.
  306. virtual isc::dns::RRClass getClass() const = 0;
  307. //@}
  308. ///
  309. /// \name Search Methods
  310. ///
  311. //@{
  312. /// Search the zone for a given pair of domain name and RR type.
  313. ///
  314. /// Each derived version of this method searches the underlying backend
  315. /// for the data that best matches the given name and type.
  316. /// This method is expected to be "intelligent", and identifies the
  317. /// best possible answer for the search key. Specifically,
  318. ///
  319. /// - If the search name belongs under a zone cut, it returns the code
  320. /// of \c DELEGATION and the NS RRset at the zone cut.
  321. /// - If there is no matching name, it returns the code of \c NXDOMAIN.
  322. /// - If there is a matching name but no RRset of the search type, it
  323. /// returns the code of \c NXRRSET. This case includes the search name
  324. /// matches an empty node of the zone.
  325. /// - If there is a CNAME RR of the searched name but there is no
  326. /// RR of the searched type of the name (so this type is different from
  327. /// CNAME), it returns the code of \c CNAME and that CNAME RR.
  328. /// Note that if the searched RR type is CNAME, it is considered
  329. /// a successful match, and the code of \c SUCCESS will be returned.
  330. /// - If the search name matches a delegation point of DNAME, it returns
  331. /// the code of \c DNAME and that DNAME RR.
  332. ///
  333. /// No RRset will be returned in the \c NXDOMAIN and \c NXRRSET cases
  334. /// (\c rrset member of \c FindContext will be NULL), unless DNSSEC data
  335. /// are required. See below for the cases with DNSSEC.
  336. ///
  337. /// The returned \c FindContext object can also provide supplemental
  338. /// information about the search result via its methods returning a
  339. /// boolean value. Such information may be useful for the caller if
  340. /// the caller wants to collect additional DNSSEC proofs based on the
  341. /// search result.
  342. ///
  343. /// The \c options parameter specifies customized behavior of the search.
  344. /// Their semantics is as follows (they are or bit-field):
  345. ///
  346. /// - \c FIND_GLUE_OK Allow search under a zone cut. By default the search
  347. /// will stop once it encounters a zone cut. If this option is specified
  348. /// it remembers information about the highest zone cut and continues
  349. /// the search until it finds an exact match for the given name or it
  350. /// detects there is no exact match. If an exact match is found,
  351. /// RRsets for that name are searched just like the normal case;
  352. /// otherwise, if the search has encountered a zone cut, \c DELEGATION
  353. /// with the information of the highest zone cut will be returned.
  354. /// - \c FIND_DNSSEC Request that DNSSEC data (like NSEC, RRSIGs) are
  355. /// returned with the answer. It is allowed for the data source to
  356. /// include them even when not requested.
  357. /// - \c NO_WILDCARD Do not try wildcard matching. This option is of no
  358. /// use for normal lookups; it's intended to be used to get a DNSSEC
  359. /// proof of the non existence of any matching wildcard or non existence
  360. /// of an exact match when a wildcard match is found.
  361. ///
  362. /// In general, \c name is expected to be included in the zone, that is,
  363. /// it should be equal to or a subdomain of the zone origin. Otherwise
  364. /// this method will return \c NXDOMAIN with an empty RRset. But such a
  365. /// case should rather be considered a caller's bug.
  366. ///
  367. /// \note For this reason it's probably better to throw an exception
  368. /// than returning \c NXDOMAIN. This point should be revisited in a near
  369. /// future version. In any case applications shouldn't call this method
  370. /// for an out-of-zone name.
  371. ///
  372. /// <b>DNSSEC considerations:</b>
  373. /// The result when DNSSEC data are required can be very complicated,
  374. /// especially if it involves negative result or wildcard match.
  375. /// Specifically, if an application calls this method for DNS query
  376. /// processing with DNSSEC data, and if the search result code is
  377. /// either \c NXDOMAIN or \c NXRRRSET, and/or \c isWildcard() returns
  378. /// true, then the application will need to find additional NSEC or
  379. /// NSEC3 records for supplemental proofs. This method helps the
  380. /// application for such post search processing.
  381. ///
  382. /// First, it tells the application whether the zone is signed with
  383. /// NSEC or NSEC3 via the \c isNSEC(3)Signed() method. Any sanely signed
  384. /// zone should be signed with either (and only one) of these two types
  385. /// of RRs; however, the application should expect that the zone could
  386. /// be broken and these methods could both return false. But this method
  387. /// should ensure that not both of these methods return true.
  388. ///
  389. /// In case it's signed with NSEC3, there is no further information
  390. /// returned from this method.
  391. ///
  392. /// In case it's signed with NSEC, this method will possibly return
  393. /// a related NSEC RRset in the \c rrset member of \c FindContext.
  394. /// What kind of NSEC is returned depends on the result code
  395. /// (\c NXDOMAIN or \c NXRRSET) and on whether it's a wildcard match:
  396. ///
  397. /// - In case of NXDOMAIN, the returned NSEC covers the queried domain
  398. /// that proves that the query name does not exist in the zone. Note
  399. /// that this does not necessarily prove it doesn't even match a
  400. /// wildcard (even if the result of NXDOMAIN can only happen when
  401. /// there's no matching wildcard either). It is caller's
  402. /// responsibility to provide a proof that there is no matching
  403. /// wildcard if that proof is necessary.
  404. /// - In case of NXRRSET, we need to consider the following cases
  405. /// referring to Section 3.1.3 of RFC4035:
  406. ///
  407. /// -# (Normal) no data: there is a matching non-wildcard name with a
  408. /// different RR type. This is the "No Data" case of the RFC.
  409. /// -# (Normal) empty non terminal: there is no matching (exact or
  410. /// wildcard) name, but there is a subdomain with an RR of the query
  411. /// name. This is one case of "Name Error" of the RFC.
  412. /// -# Wildcard empty non terminal: similar to 2a, but the empty name
  413. /// is a wildcard, and matches the query name by wildcard expansion.
  414. /// This is a special case of "Name Error" of the RFC.
  415. /// -# Wildcard no data: there is no exact match name, but there is a
  416. /// wildcard name that matches the query name with a different type
  417. /// of RR. This is the "Wildcard No Data" case of the RFC.
  418. ///
  419. /// In case 1, \c find() returns NSEC of the matching name.
  420. ///
  421. /// In case 2, \c find() will return NSEC for the interval where the
  422. /// empty nonterminal lives. The end of the interval is the subdomain
  423. /// causing existence of the empty nonterminal (if there's
  424. /// sub.x.example.com, and no record in x.example.com, then
  425. /// x.example.com exists implicitly - is the empty nonterminal and
  426. /// sub.x.example.com is the subdomain causing it). Note that this NSEC
  427. /// proves not only the existence of empty non terminal name but also
  428. /// the non existence of possibly matching wildcard name, because
  429. /// there can be no better wildcard match than the exact matching empty
  430. /// name.
  431. ///
  432. /// In case 3, \c find() will return NSEC for the interval where the
  433. /// wildcard empty nonterminal lives. Cases 2 and 3 are especially
  434. /// complicated and confusing. See the examples below.
  435. ///
  436. /// In case 4, \c find() will return NSEC of the matching wildcard name.
  437. ///
  438. /// Examples: if zone "example.com" has the following record:
  439. /// \code
  440. /// a.example.com. NSEC a.b.example.com.
  441. /// \endcode
  442. /// a call to \c find() for "b.example.com." with the FIND_DNSSEC option
  443. /// will result in NXRRSET, and this NSEC will be returned.
  444. /// Likewise, if zone "example.org" has the following record,
  445. /// \code
  446. /// a.example.org. NSEC x.*.b.example.org.
  447. /// \endcode
  448. /// a call to \c find() for "y.b.example.org" with FIND_DNSSEC will
  449. /// result in NXRRSET and this NSEC; \c isWildcard() on the returned
  450. /// \c FindContext object will return true.
  451. ///
  452. /// \exception std::bad_alloc Memory allocation such as for constructing
  453. /// the resulting RRset fails
  454. /// \throw OutOfZone The Name \c name is outside of the origin of the
  455. /// zone of this ZoneFinder.
  456. /// \exception DataSourceError Derived class specific exception, e.g.
  457. /// when encountering a bad zone configuration or database connection
  458. /// failure. Although these are considered rare, exceptional events,
  459. /// it can happen under relatively usual conditions (unlike memory
  460. /// allocation failure). So, in general, the application is expected
  461. /// to catch this exception, either specifically or as a result of
  462. /// catching a base exception class, and handle it gracefully.
  463. ///
  464. /// \param name The domain name to be searched for.
  465. /// \param type The RR type to be searched for.
  466. /// \param options The search options.
  467. /// \return A \c FindContext object enclosing the search result
  468. /// (see above).
  469. virtual boost::shared_ptr<Context> find(const isc::dns::Name& name,
  470. const isc::dns::RRType& type,
  471. const FindOptions options
  472. = FIND_DEFAULT) = 0;
  473. ///
  474. /// \brief Finds all RRsets in the given name.
  475. ///
  476. /// This function works almost exactly in the same way as the find one. The
  477. /// only difference is, when the lookup is successful (eg. the code is
  478. /// SUCCESS), all the RRsets residing in the named node are
  479. /// copied into the \c target parameter and the rrset member of the result
  480. /// is NULL. All the other (unsuccessful) cases are handled the same,
  481. /// including returning delegations, NSEC/NSEC3 availability and NSEC
  482. /// proofs, wildcard information etc. The options parameter works the
  483. /// same way and it should conform to the same exception restrictions.
  484. ///
  485. /// \param name \see find, parameter name
  486. /// \param target the successfull result is returned through this
  487. /// \param options \see find, parameter options
  488. /// \return \see find and it's result
  489. virtual boost::shared_ptr<Context> findAll(
  490. const isc::dns::Name& name,
  491. std::vector<isc::dns::ConstRRsetPtr> &target,
  492. const FindOptions options = FIND_DEFAULT) = 0;
  493. /// A helper structure to represent the search result of \c findNSEC3().
  494. ///
  495. /// The idea is similar to that of \c FindContext, but \c findNSEC3() has
  496. /// special interface and semantics, we use a different structure to
  497. /// represent the result.
  498. struct FindNSEC3Result {
  499. FindNSEC3Result(bool param_matched, uint8_t param_closest_labels,
  500. isc::dns::ConstRRsetPtr param_closest_proof,
  501. isc::dns::ConstRRsetPtr param_next_proof) :
  502. matched(param_matched), closest_labels(param_closest_labels),
  503. closest_proof(param_closest_proof),
  504. next_proof(param_next_proof)
  505. {}
  506. /// true iff closest_proof is a matching NSEC3
  507. const bool matched;
  508. /// The number of labels of the identified closest encloser.
  509. const uint8_t closest_labels;
  510. /// Either the NSEC3 for the closest provable encloser of the given
  511. /// name or NSEC3 that covers the name
  512. const isc::dns::ConstRRsetPtr closest_proof;
  513. /// When non NULL, NSEC3 for the next closer name.
  514. const isc::dns::ConstRRsetPtr next_proof;
  515. };
  516. /// Search the zone for the NSEC3 RR(s) that prove existence or non
  517. /// existence of a give name.
  518. ///
  519. /// It searches the NSEC3 namespace of the zone (how that namespace is
  520. /// implemented can vary in specific data source implementation) for NSEC3
  521. /// RRs that match or cover the NSEC3 hash value for the given name.
  522. ///
  523. /// If \c recursive is false, it will first look for the NSEC3 that has
  524. /// a matching hash. If it doesn't exist, it identifies the covering NSEC3
  525. /// for the hash. In either case the search stops at that point and the
  526. /// found NSEC3 RR(set) will be returned in the closest_proof member of
  527. /// \c FindNSEC3Result. \c matched is true or false depending on
  528. /// the found NSEC3 is a matched one or covering one. \c next_proof
  529. /// is always NULL. closest_labels must be equal to the number of
  530. /// labels of \c name (and therefore meaningless).
  531. ///
  532. /// If \c recursive is true, it will continue the search toward the zone
  533. /// apex (origin name) until it finds a provable encloser, that is,
  534. /// an ancestor of \c name that has a matching NSEC3. This is the closest
  535. /// provable encloser of \c name as defined in RFC5155. In this case,
  536. /// if the found encloser is not equal to \c name, the search should
  537. /// have seen a covering NSEC3 for the immediate child of the found
  538. /// encloser. That child name is the next closer name as defined in
  539. /// RFC5155. In this case, this method returns the NSEC3 for the
  540. /// closest encloser in \c closest_proof, and the NSEC3 for the next
  541. /// closer name in \c next_proof of \c FindNSEC3Result. This set of
  542. /// NSEC3 RRs provide the closest encloser proof as defined in RFC5155.
  543. /// closest_labels will be set to the number of labels of the identified
  544. /// closest encloser. This will be useful when the caller needs to
  545. /// construct the closest encloser name from the original \c name.
  546. /// If, on the other hand, the found closest name is equal to \c name,
  547. /// this method simply returns it in \c closest_proof. \c next_proof
  548. /// is set to NULL. In all cases \c matched is set to true.
  549. /// closest_labels will be set to the number of labels of \c name.
  550. ///
  551. /// When looking for NSEC3, this method retrieves NSEC3 parameters from
  552. /// the corresponding zone to calculate hash values. Actual implementation
  553. /// of how to do this will differ in different data sources. If the
  554. /// NSEC3 parameters are not available \c DataSourceError exception
  555. /// will be thrown.
  556. ///
  557. /// \note This implicitly means this method assumes the zone does not
  558. /// have more than one set of parameters. This assumption should be
  559. /// reasonable in actual deployment and will help simplify the interface
  560. /// and implementation. But if there's a real need for supporting
  561. /// multiple sets of parameters in a single zone, we will have to
  562. /// extend this method so that, e.g., the caller can specify the parameter
  563. /// set.
  564. ///
  565. /// In general, this method expects the zone is properly signed with NSEC3
  566. /// RRs. Specifically, it assumes at least the apex node has a matching
  567. /// NSEC3 RR (so the search in the recursive mode must always succeed);
  568. /// it also assumes that it can retrieve NSEC parameters (iterations,
  569. /// algorithm, and salt) from the zone as noted above. If these
  570. /// assumptions aren't met, \c DataSourceError exception will be thrown.
  571. ///
  572. /// \exception OutOfZone name is not a subdomain of the zone origin
  573. /// \exception DataSourceError Low-level or internal datasource errors
  574. /// happened, or the zone isn't properly signed with NSEC3
  575. /// (NSEC3 parameters cannot be found, no NSEC3s are available, etc).
  576. /// \exception std::bad_alloc The underlying implementation involves
  577. /// memory allocation and it fails
  578. ///
  579. /// \param name The name for which NSEC3 RRs are to be found. It must
  580. /// be a subdomain of the zone.
  581. /// \param recursive Whether or not search should continue until it finds
  582. /// a provable encloser (see above).
  583. ///
  584. /// \return The search result and whether or not the closest_proof is
  585. /// a matching NSEC3, in the form of \c FindNSEC3Result object.
  586. virtual FindNSEC3Result
  587. findNSEC3(const isc::dns::Name& name, bool recursive) = 0;
  588. /// \brief Get previous name in the zone
  589. ///
  590. /// Gets the previous name in the DNSSEC order. This can be used
  591. /// to find the correct NSEC records for proving nonexistence
  592. /// of domains.
  593. ///
  594. /// The concrete implementation might throw anything it thinks appropriate,
  595. /// however it is recommended to stick to the ones listed here. The user
  596. /// of this method should be able to handle any exceptions.
  597. ///
  598. /// This method does not include under-zone-cut data (glue data).
  599. ///
  600. /// \param query The name for which one we look for a previous one. The
  601. /// queried name doesn't have to exist in the zone.
  602. /// \return The preceding name
  603. ///
  604. /// \throw NotImplemented in case the data source backend doesn't support
  605. /// DNSSEC or there is no previous in the zone (NSEC records might be
  606. /// missing in the DB, the queried name is less or equal to the apex).
  607. /// \throw DataSourceError for low-level or internal datasource errors
  608. /// (like broken connection to database, wrong data living there).
  609. /// \throw std::bad_alloc For allocation errors.
  610. virtual isc::dns::Name findPreviousName(const isc::dns::Name& query)
  611. const = 0;
  612. //@}
  613. };
  614. /// \brief Operator to combine FindOptions
  615. ///
  616. /// We would need to manually static-cast the options if we put or
  617. /// between them, which is undesired with bit-flag options. Therefore
  618. /// we hide the cast here, which is the simplest solution and it still
  619. /// provides reasonable level of type safety.
  620. inline ZoneFinder::FindOptions operator |(ZoneFinder::FindOptions a,
  621. ZoneFinder::FindOptions b)
  622. {
  623. return (static_cast<ZoneFinder::FindOptions>(static_cast<unsigned>(a) |
  624. static_cast<unsigned>(b)));
  625. }
  626. /// \brief Operator to combine FindResultFlags
  627. ///
  628. /// Similar to the same operator for \c FindOptions. Refer to the description
  629. /// of that function.
  630. inline ZoneFinder::FindResultFlags operator |(
  631. ZoneFinder::FindResultFlags a,
  632. ZoneFinder::FindResultFlags b)
  633. {
  634. return (static_cast<ZoneFinder::FindResultFlags>(
  635. static_cast<unsigned>(a) | static_cast<unsigned>(b)));
  636. }
  637. /// \brief A pointer-like type pointing to a \c ZoneFinder object.
  638. typedef boost::shared_ptr<ZoneFinder> ZoneFinderPtr;
  639. /// \brief A pointer-like type pointing to an immutable \c ZoneFinder object.
  640. typedef boost::shared_ptr<const ZoneFinder> ConstZoneFinderPtr;
  641. /// \brief A pointer-like type pointing to a \c ZoneFinder::Context object.
  642. typedef boost::shared_ptr<ZoneFinder::Context> ZoneFinderContextPtr;
  643. /// \brief A pointer-like type pointing to an immutable
  644. /// \c ZoneFinder::Context object.
  645. typedef boost::shared_ptr<ZoneFinder::Context> ConstZoneFinderContextPtr;
  646. /// The base class to make updates to a single zone.
  647. ///
  648. /// On construction, each derived class object will start a "transaction"
  649. /// for making updates to a specific zone (this means a constructor of
  650. /// a derived class would normally take parameters to identify the zone
  651. /// to be updated). The underlying realization of a "transaction" will differ
  652. /// for different derived classes; if it uses a general purpose database
  653. /// as a backend, it will involve performing some form of "begin transaction"
  654. /// statement for the database.
  655. ///
  656. /// Updates (adding or deleting RRs) are made via \c addRRset() and
  657. /// \c deleteRRset() methods. Until the \c commit() method is called the
  658. /// changes are local to the updater object. For example, they won't be
  659. /// visible via a \c ZoneFinder object except the one returned by the
  660. /// updater's own \c getFinder() method. The \c commit() completes the
  661. /// transaction and makes the changes visible to others.
  662. ///
  663. /// This class does not provide an explicit "rollback" interface. If
  664. /// something wrong or unexpected happens during the updates and the
  665. /// caller wants to cancel the intermediate updates, the caller should
  666. /// simply destruct the updater object without calling \c commit().
  667. /// The destructor is supposed to perform the "rollback" operation,
  668. /// depending on the internal details of the derived class.
  669. ///
  670. /// \note This initial implementation provides a quite simple interface of
  671. /// adding and deleting RRs (see the description of the related methods).
  672. /// It may be revisited as we gain more experiences.
  673. class ZoneUpdater {
  674. protected:
  675. /// The default constructor.
  676. ///
  677. /// This is intentionally defined as protected to ensure that this base
  678. /// class is never instantiated directly.
  679. ZoneUpdater() {}
  680. public:
  681. /// The destructor
  682. ///
  683. /// Each derived class implementation must ensure that if \c commit()
  684. /// has not been performed by the time of the call to it, then it
  685. /// "rollbacks" the updates made via the updater so far.
  686. virtual ~ZoneUpdater() {}
  687. /// Return a finder for the zone being updated.
  688. ///
  689. /// The returned finder provides the functionalities of \c ZoneFinder
  690. /// for the zone as updates are made via the updater. That is, before
  691. /// making any update, the finder will be able to find all RRsets that
  692. /// exist in the zone at the time the updater is created. If RRsets
  693. /// are added or deleted via \c addRRset() or \c deleteRRset(),
  694. /// this finder will find the added ones or miss the deleted ones
  695. /// respectively.
  696. ///
  697. /// The finder returned by this method is effective only while the updates
  698. /// are performed, i.e., from the construction of the corresponding
  699. /// updater until \c commit() is performed or the updater is destructed
  700. /// without commit. The result of a subsequent call to this method (or
  701. /// the use of the result) after that is undefined.
  702. ///
  703. /// \return A reference to a \c ZoneFinder for the updated zone
  704. virtual ZoneFinder& getFinder() = 0;
  705. /// Add an RRset to a zone via the updater
  706. ///
  707. /// This may be revisited in a future version, but right now the intended
  708. /// behavior of this method is simple: It "naively" adds the specified
  709. /// RRset to the zone specified on creation of the updater.
  710. /// It performs minimum level of validation on the specified RRset:
  711. /// - Whether the RR class is identical to that for the zone to be updated
  712. /// - Whether the RRset is not empty, i.e., it has at least one RDATA
  713. /// - Whether the RRset is not associated with an RRSIG, i.e.,
  714. /// whether \c getRRsig() on the RRset returns a NULL pointer.
  715. ///
  716. /// and otherwise does not check any oddity. For example, it doesn't
  717. /// check whether the owner name of the specified RRset is a subdomain
  718. /// of the zone's origin; it doesn't care whether or not there is already
  719. /// an RRset of the same name and RR type in the zone, and if there is,
  720. /// whether any of the existing RRs have duplicate RDATA with the added
  721. /// ones. If these conditions matter the calling application must examine
  722. /// the existing data beforehand using the \c ZoneFinder returned by
  723. /// \c getFinder().
  724. ///
  725. /// The validation requirement on the associated RRSIG is temporary.
  726. /// If we find it more reasonable and useful to allow adding a pair of
  727. /// RRset and its RRSIG RRset as we gain experiences with the interface,
  728. /// we may remove this restriction. Until then we explicitly check it
  729. /// to prevent accidental misuse.
  730. ///
  731. /// Conceptually, on successful call to this method, the zone will have
  732. /// the specified RRset, and if there is already an RRset of the same
  733. /// name and RR type, these two sets will be "merged". "Merged" means
  734. /// that a subsequent call to \c ZoneFinder::find() for the name and type
  735. /// will result in success and the returned RRset will contain all
  736. /// previously existing and newly added RDATAs with the TTL being the
  737. /// minimum of the two RRsets. The underlying representation of the
  738. /// "merged" RRsets may vary depending on the characteristic of the
  739. /// underlying data source. For example, if it uses a general purpose
  740. /// database that stores each RR of the same RRset separately, it may
  741. /// simply be a larger sets of RRs based on both the existing and added
  742. /// RRsets; the TTLs of the RRs may be different within the database, and
  743. /// there may even be duplicate RRs in different database rows. As long
  744. /// as the RRset returned via \c ZoneFinder::find() conforms to the
  745. /// concept of "merge", the actual internal representation is up to the
  746. /// implementation.
  747. ///
  748. /// This method must not be called once commit() is performed. If it
  749. /// calls after \c commit() the implementation must throw a
  750. /// \c DataSourceError exception.
  751. ///
  752. /// If journaling was requested when getting this updater, it will reject
  753. /// to add the RRset if the squence doesn't look like and IXFR (see
  754. /// DataSourceClient::getUpdater). In such case isc::BadValue is thrown.
  755. ///
  756. /// \todo As noted above we may have to revisit the design details as we
  757. /// gain experiences:
  758. ///
  759. /// - we may want to check (and maybe reject) if there is already a
  760. /// duplicate RR (that has the same RDATA).
  761. /// - we may want to check (and maybe reject) if there is already an
  762. /// RRset of the same name and RR type with different TTL
  763. /// - we may even want to check if there is already any RRset of the
  764. /// same name and RR type.
  765. /// - we may want to add an "options" parameter that can control the
  766. /// above points
  767. /// - we may want to have this method return a value containing the
  768. /// information on whether there's a duplicate, etc.
  769. ///
  770. /// \exception DataSourceError Called after \c commit(), RRset is invalid
  771. /// (see above), internal data source error
  772. /// \exception isc::BadValue Journaling is enabled and the current RRset
  773. /// doesn't fit into the IXFR sequence (see above).
  774. /// \exception std::bad_alloc Resource allocation failure
  775. ///
  776. /// \param rrset The RRset to be added
  777. virtual void addRRset(const isc::dns::AbstractRRset& rrset) = 0;
  778. /// Delete an RRset from a zone via the updater
  779. ///
  780. /// Like \c addRRset(), the detailed semantics and behavior of this method
  781. /// may have to be revisited in a future version. The following are
  782. /// based on the initial implementation decisions.
  783. ///
  784. /// On successful completion of this method, it will remove from the zone
  785. /// the RRs of the specified owner name and RR type that match one of
  786. /// the RDATAs of the specified RRset. There are several points to be
  787. /// noted:
  788. /// - Existing RRs that don't match any of the specified RDATAs will
  789. /// remain in the zone.
  790. /// - Any RRs of the specified RRset that doesn't exist in the zone will
  791. /// simply be ignored; the implementation of this method is not supposed
  792. /// to check that condition.
  793. /// - The TTL of the RRset is ignored; matching is only performed by
  794. /// the owner name, RR type and RDATA
  795. ///
  796. /// Ignoring the TTL may not look sensible, but it's based on the
  797. /// observation that it will result in more intuitive result, especially
  798. /// when the underlying data source is a general purpose database.
  799. /// See also \c DatabaseAccessor::deleteRecordInZone() on this point.
  800. /// It also matches the dynamic update protocol (RFC2136), where TTLs
  801. /// are ignored when deleting RRs.
  802. ///
  803. /// \note Since the TTL is ignored, this method could take the RRset
  804. /// to be deleted as a tuple of name, RR type, and a list of RDATAs.
  805. /// But in practice, it's quite likely that the caller has the RRset
  806. /// in the form of the \c RRset object (e.g., extracted from a dynamic
  807. /// update request message), so this interface would rather be more
  808. /// convenient. If it turns out not to be true we can change or extend
  809. /// the method signature.
  810. ///
  811. /// This method performs minimum level of validation on the specified
  812. /// RRset:
  813. /// - Whether the RR class is identical to that for the zone to be updated
  814. /// - Whether the RRset is not empty, i.e., it has at least one RDATA
  815. /// - Whether the RRset is not associated with an RRSIG, i.e.,
  816. /// whether \c getRRsig() on the RRset returns a NULL pointer.
  817. ///
  818. /// This method must not be called once commit() is performed. If it
  819. /// calls after \c commit() the implementation must throw a
  820. /// \c DataSourceError exception.
  821. ///
  822. /// If journaling was requested when getting this updater, it will reject
  823. /// to add the RRset if the squence doesn't look like and IXFR (see
  824. /// DataSourceClient::getUpdater). In such case isc::BadValue is thrown.
  825. ///
  826. /// \todo As noted above we may have to revisit the design details as we
  827. /// gain experiences:
  828. ///
  829. /// - we may want to check (and maybe reject) if some or all of the RRs
  830. /// for the specified RRset don't exist in the zone
  831. /// - we may want to allow an option to "delete everything" for specified
  832. /// name and/or specified name + RR type.
  833. /// - as mentioned above, we may want to include the TTL in matching the
  834. /// deleted RRs
  835. /// - we may want to add an "options" parameter that can control the
  836. /// above points
  837. /// - we may want to have this method return a value containing the
  838. /// information on whether there's any RRs that are specified but don't
  839. /// exit, the number of actually deleted RRs, etc.
  840. ///
  841. /// \exception DataSourceError Called after \c commit(), RRset is invalid
  842. /// (see above), internal data source error
  843. /// \exception isc::BadValue Journaling is enabled and the current RRset
  844. /// doesn't fit into the IXFR sequence (see above).
  845. /// \exception std::bad_alloc Resource allocation failure
  846. ///
  847. /// \param rrset The RRset to be deleted
  848. virtual void deleteRRset(const isc::dns::AbstractRRset& rrset) = 0;
  849. /// Commit the updates made in the updater to the zone
  850. ///
  851. /// This method completes the "transaction" started at the creation
  852. /// of the updater. After successful completion of this method, the
  853. /// updates will be visible outside the scope of the updater.
  854. /// The actual internal behavior will defer for different derived classes.
  855. /// For a derived class with a general purpose database as a backend,
  856. /// for example, this method would perform a "commit" statement for the
  857. /// database.
  858. ///
  859. /// This operation can only be performed at most once. A duplicate call
  860. /// must result in a DatasourceError exception.
  861. ///
  862. /// \exception DataSourceError Duplicate call of the method,
  863. /// internal data source error
  864. /// \exception isc::BadValue Journaling is enabled and the update is not
  865. /// complete IXFR sequence.
  866. virtual void commit() = 0;
  867. };
  868. /// \brief A pointer-like type pointing to a \c ZoneUpdater object.
  869. typedef boost::shared_ptr<ZoneUpdater> ZoneUpdaterPtr;
  870. /// The base class for retrieving differences between two versions of a zone.
  871. ///
  872. /// On construction, each derived class object will internally set up
  873. /// retrieving sequences of differences between two specific version of
  874. /// a specific zone managed in a particular data source. So the constructor
  875. /// of a derived class would normally take parameters to identify the zone
  876. /// and the two versions for which the differences should be retrieved.
  877. /// See \c DataSourceClient::getJournalReader for more concrete details
  878. /// used in this API.
  879. ///
  880. /// Once constructed, an object of this class will act like an iterator
  881. /// over the sequences. Every time the \c getNextDiff() method is called
  882. /// it returns one element of the differences in the form of an \c RRset
  883. /// until it reaches the end of the entire sequences.
  884. class ZoneJournalReader {
  885. public:
  886. /// Result codes used by a factory method for \c ZoneJournalReader
  887. enum Result {
  888. SUCCESS, ///< A \c ZoneJournalReader object successfully created
  889. NO_SUCH_ZONE, ///< Specified zone does not exist in the data source
  890. NO_SUCH_VERSION ///< Specified versions do not exist in the diff storage
  891. };
  892. protected:
  893. /// The default constructor.
  894. ///
  895. /// This is intentionally defined as protected to ensure that this base
  896. /// class is never instantiated directly.
  897. ZoneJournalReader() {}
  898. public:
  899. /// The destructor
  900. virtual ~ZoneJournalReader() {}
  901. /// Return the next difference RR of difference sequences.
  902. ///
  903. /// In this API, the difference between two versions of a zone is
  904. /// conceptually represented as IXFR-style difference sequences:
  905. /// Each difference sequence is a sequence of RRs: an older version of
  906. /// SOA (to be deleted), zero or more other deleted RRs, the
  907. /// post-transaction SOA (to be added), and zero or more other
  908. /// added RRs. (Note, however, that the underlying data source
  909. /// implementation may or may not represent the difference in
  910. /// straightforward realization of this concept. The mapping between
  911. /// the conceptual difference and the actual implementation is hidden
  912. /// in each derived class).
  913. ///
  914. /// This method provides an application with a higher level interface
  915. /// to retrieve the difference along with the conceptual model: the
  916. /// \c ZoneJournalReader object iterates over the entire sequences
  917. /// from the beginning SOA (which is to be deleted) to one of the
  918. /// added RR of with the ending SOA, and each call to this method returns
  919. /// one RR in the form of an \c RRset that contains exactly one RDATA
  920. /// in the order of the sequences.
  921. ///
  922. /// Note that the ordering of the sequences specifies the semantics of
  923. /// each difference: add or delete. For example, the first RR is to
  924. /// be deleted, and the last RR is to be added. So the return value
  925. /// of this method does not explicitly indicate whether the RR is to be
  926. /// added or deleted.
  927. ///
  928. /// This method ensures the returned \c RRset represents an RR, that is,
  929. /// it contains exactly one RDATA. However, it does not necessarily
  930. /// ensure that the resulting sequences are in the form of IXFR-style.
  931. /// For example, the first RR is supposed to be an SOA, and it should
  932. /// normally be the case, but this interface does not necessarily require
  933. /// the derived class implementation ensure this. Normally the
  934. /// differences are expected to be stored using this API (via a
  935. /// \c ZoneUpdater object), and as long as that is the case and the
  936. /// underlying implementation follows the requirement of the API, the
  937. /// result of this method should be a valid IXFR-style sequences.
  938. /// So this API does not mandate the almost redundant check as part of
  939. /// the interface. If the application needs to make it sure 100%, it
  940. /// must check the resulting sequence itself.
  941. ///
  942. /// Once the object reaches the end of the sequences, this method returns
  943. /// \c Null. Any subsequent call will result in an exception of
  944. /// class \c InvalidOperation.
  945. ///
  946. /// \exception InvalidOperation The method is called beyond the end of
  947. /// the difference sequences.
  948. /// \exception DataSourceError Underlying data is broken and the RR
  949. /// cannot be created or other low level data source error.
  950. ///
  951. /// \return An \c RRset that contains one RDATA corresponding to the
  952. /// next difference in the sequences.
  953. virtual isc::dns::ConstRRsetPtr getNextDiff() = 0;
  954. };
  955. /// \brief A pointer-like type pointing to a \c ZoneUpdater object.
  956. typedef boost::shared_ptr<ZoneJournalReader> ZoneJournalReaderPtr;
  957. } // end of datasrc
  958. } // end of isc
  959. #endif // __ZONE_H
  960. // Local Variables:
  961. // mode: c++
  962. // End: