Kea  2.3.5-git
client_class_def_parser.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2022 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 
7 #ifndef CLIENT_CLASS_DEF_PARSER_H
8 #define CLIENT_CLASS_DEF_PARSER_H
9 
10 #include <cc/data.h>
11 #include <cc/simple_parser.h>
12 #include <eval/eval_context.h>
15 #include <functional>
16 #include <list>
17 
55 namespace isc {
56 namespace dhcp {
57 
64 public:
65 
75  void parse(ExpressionPtr& expression,
76  isc::data::ConstElementPtr expression_cfg,
77  uint16_t family,
80 };
81 
86 public:
87 
90  }
91 
107  void parse(ClientClassDictionaryPtr& class_dictionary,
108  isc::data::ConstElementPtr client_class_def,
109  uint16_t family,
110  bool append_error_position = true,
111  bool check_dependencies = true);
112 
122  void checkParametersSupported(const isc::data::ConstElementPtr& class_def_cfg,
123  const uint16_t family);
124 
125 protected:
126 
137  virtual boost::shared_ptr<OptionDataListParser>
138  createOptionDataListParser(const uint16_t address_family,
139  CfgOptionDefPtr cfg_option_def) const;
140 };
141 
143 typedef boost::shared_ptr<ClientClassDefParser> ClientClassDefParserPtr;
144 
152 public:
153 
168  parse(isc::data::ConstElementPtr class_def_list, uint16_t family,
169  bool check_dependencies = true);
170 };
171 
172 } // end of namespace isc::dhcp
173 } // end of namespace isc
174 
175 #endif // CLIENT_CLASS_DEF_PARSER_H
Parser for a single client class definition.
void parse(ExpressionPtr &expression, isc::data::ConstElementPtr expression_cfg, uint16_t family, isc::eval::EvalContext::CheckDefined check_defined=isc::eval::EvalContext::acceptAll, isc::eval::EvalContext::ParserType parser_type=isc::eval::EvalContext::PARSER_BOOL)
Parses an expression configuration element into an Expression.
virtual ~ClientClassDefParser()
Virtual destructor.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
expression is expected to evaluate to bool
Definition: eval_context.h:39
Parser for a logical expression.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
Defines the logger used by the top-level component of kea-lfc.
ParserType
Specifies what type of expression the parser is expected to see.
Definition: eval_context.h:38
boost::shared_ptr< ClientClassDefParser > ClientClassDefParserPtr
Defines a pointer to a ClientClassDefParser.
std::function< bool(const ClientClass &)> CheckDefined
Type of the check defined function.
Definition: eval_context.h:44
Defines classes for storing client class definitions.
Parser for a list of client class definitions.
boost::shared_ptr< Expression > ExpressionPtr
Definition: token.h:30
static bool acceptAll(const ClientClass &client_class)
Accept all client class names.
Definition: eval_context.cc:32