Kea  2.3.5-git
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 
14 namespace isc {
15 namespace dhcp {
16 
19 public:
20 
22  virtual ~HostReservationParser() { }
23 
33  virtual HostPtr
34  parse(const SubnetID& subnet_id,
35  isc::data::ConstElementPtr reservation_data) final;
36 
37 protected:
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 
82 protected:
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 
109 protected:
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 
141 public:
142 
145 
148 
155  void parse(isc::data::ConstElementPtr ids_list);
156 
157 protected:
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 
188 public:
189 
195 
196 protected:
197 
203  virtual bool isSupportedIdentifier(const std::string& id_name) const;
204 
205 };
206 
209 public:
210 
216 
217 protected:
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 single host reservation for DHCPv4.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
Definition: host.h:801
virtual const std::set< std::string > & getSupportedParameters(const bool identifiers_only) const =0
Returns set of the supported parameters.
Parser for a list of host identifiers for DHCPv6.
virtual HostPtr parse(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data) 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 HostPtr parseInternal(const SubnetID &subnet_id, isc::data::ConstElementPtr reservation_data)
Parses a single entry for host reservation.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
Parser for a single host reservation for DHCPv6.
Parser for a list of host identifiers.
Parser for a list of host identifiers for DHCPv4.
Defines the logger used by the top-level component of kea-lfc.
virtual ~HostReservationParser()
Destructor.
CfgHostOperationsPtr staging_cfg_
Pointer to the object holding configuration.
Parser for a single host reservation entry.
boost::shared_ptr< CfgHostOperations > CfgHostOperationsPtr
Pointer to the Non-const object.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
virtual bool isSupportedParameter(const std::string &param_name) const
Checks if the specified parameter is supported by the parser.