Kea 2.2.0
client_class_def_parser.h
Go to the documentation of this file.
1// Copyright (C) 2015-2021 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
55namespace isc {
56namespace dhcp {
57
64public:
65
74 void parse(ExpressionPtr& expression,
75 isc::data::ConstElementPtr expression_cfg,
76 uint16_t family,
79};
80
85public:
86
89 }
90
106 void parse(ClientClassDictionaryPtr& class_dictionary,
107 isc::data::ConstElementPtr client_class_def,
108 uint16_t family,
109 bool append_error_position = true,
110 bool check_dependencies = true);
111
122 const uint16_t family);
123
124protected:
125
136 virtual boost::shared_ptr<OptionDataListParser>
137 createOptionDataListParser(const uint16_t address_family,
138 CfgOptionDefPtr cfg_option_def) const;
139};
140
142typedef boost::shared_ptr<ClientClassDefParser> ClientClassDefParserPtr;
143
151public:
152
167 parse(isc::data::ConstElementPtr class_def_list, uint16_t family,
168 bool check_dependencies = true);
169};
170
171} // end of namespace isc::dhcp
172} // end of namespace isc
173
174#endif // CLIENT_CLASS_DEF_PARSER_H
Parser for a list of client class definitions.
ClientClassDictionaryPtr parse(isc::data::ConstElementPtr class_def_list, uint16_t family, bool check_dependencies=true)
Parse configuration entries.
Parser for a single client class definition.
virtual boost::shared_ptr< OptionDataListParser > createOptionDataListParser(const uint16_t address_family, CfgOptionDefPtr cfg_option_def) const
Returns an instance of the OptionDataListParser to be used in parsing the option-data structure.
virtual ~ClientClassDefParser()
Virtual destructor.
void parse(ClientClassDictionaryPtr &class_dictionary, isc::data::ConstElementPtr client_class_def, uint16_t family, bool append_error_position=true, bool check_dependencies=true)
Parses an entry that describes single client class definition.
void checkParametersSupported(const isc::data::ConstElementPtr &class_def_cfg, const uint16_t family)
Iterates over class parameters and checks if they are supported.
Parser for a logical expression.
void parse(ExpressionPtr &expression, isc::data::ConstElementPtr expression_cfg, uint16_t family, isc::eval::EvalContext::CheckDefined check_defined=isc::eval::EvalContext::acceptAll)
Parses an expression configuration element into an Expression.
std::function< bool(const ClientClass &)> CheckDefined
Type of the check defined function.
Definition: eval_context.h:44
static bool acceptAll(const ClientClass &client_class)
Accept all client class names.
Definition: eval_context.cc:32
Defines classes for storing client class definitions.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< Expression > ExpressionPtr
Definition: token.h:30
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
boost::shared_ptr< ClientClassDefParser > ClientClassDefParserPtr
Defines a pointer to a ClientClassDefParser.
Defines the logger used by the top-level component of kea-lfc.