auth_srv.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <auth/data_source.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();
  40. ~AuthSrv();
  41. //@}
  42. int processMessage(isc::dns::InputBuffer& request_buffer,
  43. isc::dns::Message& message,
  44. isc::dns::MessageRenderer& response_renderer,
  45. bool udp_buffer);
  46. void serve(std::string zone_name);
  47. isc::data::ElementPtr setDbFile(const isc::data::ElementPtr config);
  48. isc::data::ElementPtr updateConfig(isc::data::ElementPtr config);
  49. private:
  50. AuthSrvImpl* impl_;
  51. /// We keep a pointer to the currently running sqlite datasource
  52. /// so that we can specifically remove that one should the database
  53. /// file change
  54. isc::auth::ConstDataSrcPtr cur_datasrc_;
  55. };
  56. #endif // __AUTH_SRV_H
  57. // Local Variables:
  58. // mode: c++
  59. // End: