json_config_parser.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright (C) 2012-2013 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 DHCP6_CONFIG_PARSER_H
  15. #define DHCP6_CONFIG_PARSER_H
  16. #include <cc/data.h>
  17. #include <dhcpsrv/parsers/dhcp_parsers.h>
  18. #include <exceptions/exceptions.h>
  19. #include <string>
  20. namespace isc {
  21. namespace dhcp {
  22. class Dhcpv6Srv;
  23. /// @brief Configures DHCPv6 server
  24. ///
  25. /// This function is called every time a new configuration is received. The
  26. /// extra parameter is a reference to DHCPv6 server component. It is currently
  27. /// not used and CfgMgr::instance() is accessed instead.
  28. ///
  29. /// This method does not throw. It catches all exceptions and returns them as
  30. /// reconfiguration statuses. It may return the following response codes:
  31. /// 0 - configuration successful
  32. /// 1 - malformed configuration (parsing failed)
  33. /// 2 - commit failed (parsing was successful, but the values could not be
  34. /// stored in the configuration).
  35. ///
  36. /// @param server DHCPv6 server object.
  37. /// @param config_set a new configuration for DHCPv6 server.
  38. /// @return answer that contains result of the reconfiguration.
  39. /// @throw Dhcp6ConfigError if trying to create a parser for NULL config.
  40. isc::data::ConstElementPtr
  41. configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set);
  42. /// @brief Returns the global context
  43. ///
  44. /// @returns a reference to the global context
  45. ParserContextPtr& globalContext();
  46. }; // end of isc::dhcp namespace
  47. }; // end of isc namespace
  48. #endif // DHCP6_CONFIG_PARSER_H