Kea 2.2.0
host_reservation_parser.h
Go to the documentation of this file.
1// Copyright (C) 2014-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
7#ifndef HOST_RESERVATION_PARSER_H
8#define HOST_RESERVATION_PARSER_H
9
10#include <cc/data.h>
11#include <cc/simple_parser.h>
12#include <dhcpsrv/host.h>
13
14namespace isc {
15namespace dhcp {
16
19public:
20
23
33 virtual HostPtr
34 parse(const SubnetID& subnet_id,
35 isc::data::ConstElementPtr reservation_data) final;
36
37protected:
38
51 virtual HostPtr parseInternal(const SubnetID& subnet_id,
52 isc::data::ConstElementPtr reservation_data);
53
60 virtual bool isIdentifierParameter(const std::string& param_name) const;
61
67 virtual bool isSupportedParameter(const std::string& param_name) const;
68
76 virtual const std::set<std::string>&
77 getSupportedParameters(const bool identifiers_only) const = 0;
78};
79
82protected:
83
93 virtual HostPtr parseInternal(const SubnetID& subnet_id,
94 isc::data::ConstElementPtr reservation_data);
95
103 virtual const std::set<std::string>&
104 getSupportedParameters(const bool identifiers_only) const;
105};
106
109protected:
110
120 virtual HostPtr parseInternal(const SubnetID& subnet_id,
121 isc::data::ConstElementPtr reservation_data);
122
130 virtual const std::set<std::string>&
131 getSupportedParameters(const bool identifiers_only) const;
132
133};
134
141public:
142
145
148
155 void parse(isc::data::ConstElementPtr ids_list);
156
157protected:
158
168 virtual void parseInternal(isc::data::ConstElementPtr ids_list);
169
179 virtual bool isSupportedIdentifier(const std::string& id_name) const = 0;
180
183
184};
185
188public:
189
195
196protected:
197
203 virtual bool isSupportedIdentifier(const std::string& id_name) const;
204
205};
206
209public:
210
216
217protected:
218
224 virtual bool isSupportedIdentifier(const std::string& id_name) const;
225};
226
227
228}
229} // end of namespace isc
230
231#endif // HOST_RESERVATION_PARSER_H
Parser for a list of host identifiers for DHCPv4.
virtual bool isSupportedIdentifier(const std::string &id_name) const
Checks if specified identifier name is supported for DHCPv4.
Parser for a list of host identifiers for DHCPv6.
virtual bool isSupportedIdentifier(const std::string &id_name) const
Checks if specified identifier name is supported for DHCPv6.
Parser for a list of host identifiers.
CfgHostOperationsPtr staging_cfg_
Pointer to the object holding configuration.
virtual bool isSupportedIdentifier(const std::string &id_name) const =0
Checks if specified identifier name is supported in the context of the parser.
void parse(isc::data::ConstElementPtr ids_list)
Parses a list of host identifiers.
virtual void parseInternal(isc::data::ConstElementPtr ids_list)
Parses a list of host identifiers.
Parser for a single host reservation for DHCPv4.
virtual const std::set< std::string > & getSupportedParameters(const bool identifiers_only) const
Returns set of the supported parameters for DHCPv4.
virtual HostPtr parseInternal(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data)
Parses a single host reservation for DHCPv4.
Parser for a single host reservation for DHCPv6.
virtual HostPtr parseInternal(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data)
Parses a single host reservation for DHCPv6.
virtual const std::set< std::string > & getSupportedParameters(const bool identifiers_only) const
Returns set of the supported parameters for DHCPv6.
Parser for a single host reservation entry.
virtual bool isIdentifierParameter(const std::string &param_name) const
Checks if the specified parameter is a host identifier.
virtual HostPtr parseInternal(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data)
Parses a single entry for host reservation.
virtual HostPtr parse(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data) final
Parses a single entry for host reservation.
virtual const std::set< std::string > & getSupportedParameters(const bool identifiers_only) const =0
Returns set of the supported parameters.
virtual bool isSupportedParameter(const std::string &param_name) const
Checks if the specified parameter is supported by the parser.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< CfgHostOperations > CfgHostOperationsPtr
Pointer to the Non-const object.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
Definition: host.h:785
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:24
Defines the logger used by the top-level component of kea-lfc.