simple_parser.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (C) 2017 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 AGENT_SIMPLE_PARSER_H
  7. #define AGENT_SIMPLE_PARSER_H
  8. #include <cc/simple_parser.h>
  9. #include <agent/ctrl_agent_cfg_mgr.h>
  10. namespace isc {
  11. namespace agent {
  12. /// @brief SimpleParser specialized for DHCPv4
  13. ///
  14. /// This class is a @ref isc::data::SimpleParser dedicated to DHCPv4 parser.
  15. /// In particular, it contains all the default values and names of the
  16. /// parameters that are to be derived (inherited) between scopes.
  17. /// For the actual values, see @file agent/simple_parser.cc
  18. class AgentSimpleParser : public isc::data::SimpleParser {
  19. public:
  20. /// @brief Sets all defaults for Control Agent configuration
  21. ///
  22. /// This method sets global, option data and option definitions defaults.
  23. ///
  24. /// @param global scope to be filled in with defaults.
  25. /// @return number of default values added
  26. static size_t setAllDefaults(isc::data::ElementPtr global);
  27. /// @brief Parses the control agent configuration
  28. ///
  29. /// @param ctx - parsed information will be stored here
  30. /// @param config - Element tree structure that holds configuration
  31. /// @param check_only - if true the configuration is verified only, not applied
  32. ///
  33. /// @throw ConfigError if any issues are encountered.
  34. void parse(CtrlAgentCfgContextPtr ctx, isc::data::ConstElementPtr config,
  35. bool check_only);
  36. // see simple_parser.cc for comments for those parameters
  37. static const isc::data::SimpleDefaults AGENT_DEFAULTS;
  38. static const isc::data::SimpleDefaults SOCKET_DEFAULTS;
  39. };
  40. };
  41. };
  42. #endif