auth_srv.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef __AUTH_SRV_H
  16. #define __AUTH_SRV_H 1
  17. #include <string>
  18. #include <cc/data.h>
  19. #include <config/ccsession.h>
  20. namespace isc {
  21. namespace dns {
  22. class InputBuffer;
  23. class Message;
  24. class MessageRenderer;
  25. }
  26. }
  27. class AuthSrvImpl;
  28. class AuthSrv {
  29. ///
  30. /// \name Constructors, Assignment Operator and Destructor.
  31. ///
  32. /// Note: The copy constructor and the assignment operator are intentionally
  33. /// defined as private.
  34. //@{
  35. private:
  36. AuthSrv(const AuthSrv& source);
  37. AuthSrv& operator=(const AuthSrv& source);
  38. public:
  39. explicit AuthSrv(const bool use_cache);
  40. ~AuthSrv();
  41. //@}
  42. /// \return \c true if the \message contains a response to be returned;
  43. /// otherwise \c false.
  44. bool processMessage(isc::dns::InputBuffer& request_buffer,
  45. isc::dns::Message& message,
  46. isc::dns::MessageRenderer& response_renderer,
  47. bool udp_buffer);
  48. void setVerbose(bool on);
  49. bool getVerbose() const;
  50. void serve(std::string zone_name);
  51. isc::data::ElementPtr updateConfig(isc::data::ElementPtr config);
  52. isc::config::ModuleCCSession* configSession() const;
  53. void setConfigSession(isc::config::ModuleCCSession* cs);
  54. private:
  55. AuthSrvImpl* impl_;
  56. };
  57. #endif // __AUTH_SRV_H
  58. // Local Variables:
  59. // mode: c++
  60. // End: