data_source_static.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Copyright (C) 2009 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. // $Id$
  15. //
  16. // Sample Datasource implementation; this datasource only returns
  17. // static content for the queries
  18. // CH TXT version.bind
  19. // and
  20. // CH TXT authors.bind
  21. //
  22. #ifndef __STATIC_DATA_SOURCE_H
  23. #define __STATIC_DATA_SOURCE_H
  24. #include "data_source.h"
  25. namespace isc {
  26. namespace dns {
  27. class Name;
  28. class RRClass;
  29. class RRType;
  30. class RRType;
  31. class RRsetList;
  32. }
  33. namespace auth {
  34. class Query;
  35. class NameMatch;
  36. class StaticDataSrc : public DataSrc {
  37. private:
  38. ///
  39. /// \name Constructors, Assignment Operator and Destructor.
  40. ///
  41. /// Note: The copy constructor and the assignment operator are intentionally
  42. /// defined as private.
  43. //@{
  44. StaticDataSrc(const StaticDataSrc& source);
  45. StaticDataSrc& operator=(const StaticDataSrc& source);
  46. public:
  47. StaticDataSrc();
  48. ~StaticDataSrc() {}
  49. //@}
  50. void findClosestEnclosure(NameMatch& match) const;
  51. Result findRRset(const Query& q,
  52. const isc::dns::Name& qname,
  53. const isc::dns::RRClass& qclass,
  54. const isc::dns::RRType& qtype,
  55. isc::dns::RRsetList& target,
  56. uint32_t& flags,
  57. const isc::dns::Name* zonename) const;
  58. Result findExactRRset(const Query& q,
  59. const isc::dns::Name& qname,
  60. const isc::dns::RRClass& qclass,
  61. const isc::dns::RRType& qtype,
  62. isc::dns::RRsetList& target,
  63. uint32_t& flags,
  64. const isc::dns::Name* zonename) const;
  65. Result findPreviousName(const Query& q,
  66. const isc::dns::Name& qname,
  67. isc::dns::Name& target,
  68. const isc::dns::Name* zonename) const;
  69. Result init();
  70. Result close();
  71. };
  72. }
  73. }
  74. #endif
  75. // Local Variables:
  76. // mode: c++
  77. // End: