config_parser.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /// @todo: This header file and its .cc counterpart are very similar between
  17. /// DHCPv4 and DHCPv6. They should be merged. See ticket #2355.
  18. #include <cc/data.h>
  19. #include <exceptions/exceptions.h>
  20. #include <string>
  21. namespace isc {
  22. namespace dhcp {
  23. class Dhcpv6Srv;
  24. /// @brief Configures DHCPv6 server
  25. ///
  26. /// This function is called every time a new configuration is received. The extra
  27. /// parameter is a reference to DHCPv6 server component. It is currently not used
  28. /// and CfgMgr::instance() is accessed instead.
  29. ///
  30. /// This method does not throw. It catches all exceptions and returns them as
  31. /// reconfiguration statuses. It may return the following response codes:
  32. /// 0 - configuration successful
  33. /// 1 - malformed configuration (parsing failed)
  34. /// 2 - commit failed (parsing was successful, but the values could not be
  35. /// stored in the configuration).
  36. ///
  37. /// @param server DHCPv6 server object.
  38. /// @param config_set a new configuration for DHCPv6 server.
  39. /// @return answer that contains result of the reconfiguration.
  40. /// @throw Dhcp6ConfigError if trying to create a parser for NULL config.
  41. isc::data::ConstElementPtr
  42. configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set);
  43. }; // end of isc::dhcp namespace
  44. }; // end of isc namespace
  45. #endif // DHCP6_CONFIG_PARSER_H