expiration_config_parser.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. #ifndef EXPIRATION_CONFIG_PARSER_H
  7. #define EXPIRATION_CONFIG_PARSER_H
  8. #include <dhcpsrv/parsers/dhcp_config_parser.h>
  9. namespace isc {
  10. namespace dhcp {
  11. /// @brief Parser for the configuration parameters pertaining to the
  12. /// processing of expired leases.
  13. ///
  14. /// This parser iterates over parameters stored in the map and tries to
  15. /// set the appropriate values in the @c CfgExpiration object of the
  16. /// Configuration Manager.
  17. ///
  18. /// Currently supported parameters are:
  19. /// - reclaim-timer-wait-time,
  20. /// - flush-reclaimed-timer-wait-time,
  21. /// - hold-reclaimed-time,
  22. /// - max-reclaim-leases,
  23. /// - max-reclaim-time,
  24. /// - unwarned-reclaim-cycles.
  25. ///
  26. /// These parameters are optional and the default values are used for
  27. /// those that aren't specified.
  28. ///
  29. /// The parser checks if the values of the specified parameters are within
  30. /// the allowed ranges and throws exception if they are. Each parameter
  31. /// has a corresponding maximum value defined in the @c CfgExpiration class.
  32. /// None of them may be negative.
  33. class ExpirationConfigParser : public DhcpConfigParser {
  34. public:
  35. /// @brief Constructor
  36. ExpirationConfigParser();
  37. /// @brief Parses parameters in the JSON map, pertaining to the processing
  38. /// of the expired leases.
  39. ///
  40. /// @param value pointer to the content of parsed values
  41. ///
  42. /// @throw DhcpConfigError if unknown parameter specified or the
  43. /// parameter contains invalid value..
  44. virtual void build(isc::data::ConstElementPtr value);
  45. /// @brief Does nothing.
  46. virtual void commit();
  47. };
  48. } // end of namespace isc::dhcp
  49. } // end of namespace isc
  50. #endif // EXPIRATION_CONFIG_PARSER_H