Kea 2.5.9
host_reservation_parser.h
Go to the documentation of this file.
1// Copyright (C) 2014-2023 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
35 virtual HostPtr
36 parse(const SubnetID& subnet_id,
37 isc::data::ConstElementPtr reservation_data,
38 bool encapsulate_options = true) final;
39
40protected:
41
56 virtual HostPtr parseInternal(const SubnetID& subnet_id,
57 isc::data::ConstElementPtr reservation_data,
58 bool encapsulate_options);
59
66 virtual bool isIdentifierParameter(const std::string& param_name) const;
67
73 virtual bool isSupportedParameter(const std::string& param_name) const;
74
82 virtual const std::set<std::string>&
83 getSupportedParameters(const bool identifiers_only) const = 0;
84};
85
88protected:
89
101 virtual HostPtr parseInternal(const SubnetID& subnet_id,
102 isc::data::ConstElementPtr reservation_data,
103 bool encapsulate_options);
104
112 virtual const std::set<std::string>&
113 getSupportedParameters(const bool identifiers_only) const;
114};
115
118protected:
119
131 virtual HostPtr parseInternal(const SubnetID& subnet_id,
132 isc::data::ConstElementPtr reservation_data,
133 bool encapsulate_options);
134
142 virtual const std::set<std::string>&
143 getSupportedParameters(const bool identifiers_only) const;
144
145};
146
153public:
154
157
160
167 void parse(isc::data::ConstElementPtr ids_list);
168
169protected:
170
180 virtual void parseInternal(isc::data::ConstElementPtr ids_list);
181
191 virtual bool isSupportedIdentifier(const std::string& id_name) const = 0;
192
195
196};
197
200public:
201
207
208protected:
209
215 virtual bool isSupportedIdentifier(const std::string& id_name) const;
216
217};
218
221public:
222
228
229protected:
230
236 virtual bool isSupportedIdentifier(const std::string& id_name) const;
237};
238
239
240}
241} // end of namespace isc
242
243#endif // HOST_RESERVATION_PARSER_H
Parser for a list of host identifiers for DHCPv4.
Parser for a list of host identifiers 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.
Parser for a single host reservation for DHCPv4.
Parser for a single host reservation for DHCPv6.
Parser for a single host reservation entry.
virtual HostPtr parse(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data, bool encapsulate_options=true) final
Parses a single entry for host reservation.
virtual bool isIdentifierParameter(const std::string &param_name) const
Checks if the specified parameter is a host identifier.
virtual const std::set< std::string > & getSupportedParameters(const bool identifiers_only) const =0
Returns set of the supported parameters.
virtual HostPtr parseInternal(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data, bool encapsulate_options)
Parses a single entry for host reservation.
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:29
boost::shared_ptr< CfgHostOperations > CfgHostOperationsPtr
Pointer to the Non-const object.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
Definition: host.h:807
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
Defines the logger used by the top-level component of kea-lfc.