Kea 1.5.0
config_backend_pool_dhcp4.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 CONFIG_BACKEND_POOL_DHCP4_H
8#define CONFIG_BACKEND_POOL_DHCP4_H
9
10#include <cc/stamped_value.h>
14#include <dhcp/option.h>
16#include <dhcpsrv/cfg_option.h>
19#include <dhcpsrv/subnet.h>
20#include <boost/date_time/posix_time/ptime.hpp>
21#include <string>
22
23namespace isc {
24namespace dhcp {
25
27class ConfigBackendPoolDHCPv4 : public cb::BaseConfigBackendPool<ConfigBackendDHCPv4> {
28public:
29
36 virtual Subnet4Ptr
37 getSubnet4(const db::BackendSelector& backend_selector,
38 const db::ServerSelector& server_selector,
39 const std::string& subnet_prefix) const;
40
47 virtual Subnet4Ptr
48 getSubnet4(const db::BackendSelector& backend_selector,
49 const db::ServerSelector& server_selector,
50 const SubnetID& subnet_id) const;
51
57 virtual Subnet4Collection
58 getAllSubnets4(const db::BackendSelector& backend_selector,
59 const db::ServerSelector& server_selector) const;
60
67 virtual Subnet4Collection
68 getModifiedSubnets4(const db::BackendSelector& backend_selector,
69 const db::ServerSelector& server_selector,
70 const boost::posix_time::ptime& modification_time) const;
71
78 virtual SharedNetwork4Ptr
79 getSharedNetwork4(const db::BackendSelector& backend_selector,
80 const db::ServerSelector& server_selector,
81 const std::string& name) const;
82
90 getAllSharedNetworks4(const db::BackendSelector& backend_selector,
91 const db::ServerSelector& server_selector) const;
92
101 getModifiedSharedNetworks4(const db::BackendSelector& backend_selector,
102 const db::ServerSelector& server_selector,
103 const boost::posix_time::ptime& modification_time) const;
104
112 virtual OptionDefinitionPtr
113 getOptionDef4(const db::BackendSelector& backend_selector,
114 const db::ServerSelector& server_selector,
115 const uint16_t code,
116 const std::string& space) const;
117
124 virtual OptionDefContainer
125 getAllOptionDefs4(const db::BackendSelector& backend_selector,
126 const db::ServerSelector& server_selector) const;
127
136 virtual OptionDefContainer
137 getModifiedOptionDefs4(const db::BackendSelector& backend_selector,
138 const db::ServerSelector& server_selector,
139 const boost::posix_time::ptime& modification_time) const;
140
149 virtual OptionDescriptorPtr
150 getOption4(const db::BackendSelector& backend_selector,
151 const db::ServerSelector& server_selector,
152 const uint16_t code,
153 const std::string& space) const;
154
161 virtual OptionContainer
162 getAllOptions4(const db::BackendSelector& backend_selector,
163 const db::ServerSelector& server_selector) const;
164
172 virtual OptionContainer
173 getModifiedOptions4(const db::BackendSelector& backend_selector,
174 const db::ServerSelector& server_selector,
175 const boost::posix_time::ptime& modification_time) const;
176
184 getGlobalParameter4(const db::BackendSelector& backend_selector,
185 const db::ServerSelector& server_selector,
186 const std::string& name) const;
187
193 getAllGlobalParameters4(const db::BackendSelector& backend_selector,
194 const db::ServerSelector& server_selector) const;
195
204 const db::ServerSelector& server_selector,
205 const boost::posix_time::ptime& modification_time) const;
206
212 virtual void
213 createUpdateSubnet4(const db::BackendSelector& backend_selector,
214 const db::ServerSelector& server_selector,
215 const Subnet4Ptr& subnet);
216
222 virtual void
223 createUpdateSharedNetwork4(const db::BackendSelector& backend_selector,
224 const db::ServerSelector& server_selector,
225 const SharedNetwork4Ptr& shared_network);
226
232 virtual void
233 createUpdateOptionDef4(const db::BackendSelector& backend_selector,
234 const db::ServerSelector& server_selector,
235 const OptionDefinitionPtr& option_def);
236
242 virtual void
243 createUpdateOption4(const db::BackendSelector& backend_selector,
244 const db::ServerSelector& server_selector,
245 const OptionDescriptorPtr& option);
246
254 virtual void
255 createUpdateOption4(const db::BackendSelector& backend_selector,
256 const db::ServerSelector& server_selector,
257 const std::string& shared_network_name,
258 const OptionDescriptorPtr& option);
259
266 virtual void
267 createUpdateOption4(const db::BackendSelector& backend_selector,
268 const db::ServerSelector& server_selector,
269 const SubnetID& subnet_id,
270 const OptionDescriptorPtr& option);
271
281 virtual void
282 createUpdateOption4(const db::BackendSelector& backend_selector,
283 const db::ServerSelector& server_selector,
284 const asiolink::IOAddress& pool_start_address,
285 const asiolink::IOAddress& pool_end_address,
286 const OptionDescriptorPtr& option);
287
293 virtual void
295 const db::ServerSelector& server_selector,
296 const data::StampedValuePtr& value);
297
304 virtual uint64_t
305 deleteSubnet4(const db::BackendSelector& backend_selector,
306 const db::ServerSelector& server_selector,
307 const std::string& subnet_prefix);
308
315 virtual uint64_t
316 deleteSubnet4(const db::BackendSelector& backend_selector,
317 const db::ServerSelector& server_selector,
318 const SubnetID& subnet_id);
319
325 virtual uint64_t
326 deleteAllSubnets4(const db::BackendSelector& backend_selector,
327 const db::ServerSelector& server_selector);
328
335 virtual uint64_t
336 deleteSharedNetwork4(const db::BackendSelector& backend_selector,
337 const db::ServerSelector& server_selector,
338 const std::string& name);
339
345 virtual uint64_t
346 deleteAllSharedNetworks4(const db::BackendSelector& backend_selector,
347 const db::ServerSelector& server_selector);
348
356 virtual uint64_t
357 deleteOptionDef4(const db::BackendSelector& backend_selector,
358 const db::ServerSelector& server_selector,
359 const uint16_t code,
360 const std::string& space);
361
367 virtual uint64_t
368 deleteAllOptionDefs4(const db::BackendSelector& backend_selector,
369 const db::ServerSelector& server_selector);
370
378 virtual uint64_t
379 deleteOption4(const db::BackendSelector& backend_selector,
380 const db::ServerSelector& server_selector,
381 const uint16_t code,
382 const std::string& space);
383
392 virtual uint64_t
393 deleteOption4(const db::BackendSelector& backend_selector,
394 const db::ServerSelector& server_selector,
395 const std::string& shared_network_name,
396 const uint16_t code,
397 const std::string& space);
398
408 virtual uint64_t
409 deleteOption4(const db::BackendSelector& backend_selector,
410 const db::ServerSelector& server_selector,
411 const SubnetID& subnet_id,
412 const uint16_t code, const std::string& space);
413
425 virtual uint64_t
426 deleteOption4(const db::BackendSelector& backend_selector,
427 const db::ServerSelector& server_selector,
428 const asiolink::IOAddress& pool_start_address,
429 const asiolink::IOAddress& pool_end_address,
430 const uint16_t code,
431 const std::string& space);
432
439 virtual uint64_t
440 deleteGlobalParameter4(const db::BackendSelector& backend_selector,
441 const db::ServerSelector& server_selector,
442 const std::string& name);
443
449 virtual uint64_t
450 deleteAllGlobalParameters4(const db::BackendSelector& backend_selector,
451 const db::ServerSelector& server_selector);
452};
453
454
455} // end of namespace isc::dhcp
456} // end of namespace isc
457
458#endif // CONFIG_BACKEND_POOL_DHCP4_H
Base class for configuration backend pools.
Config Backend selector.
Server selector for associating objects in a database with specific servers.
Implementation of the Configuration Backend Pool for DHCPv4.
virtual data::StampedValueCollection getAllGlobalParameters4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all global parameters.
virtual void createUpdateOption4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const OptionDescriptorPtr &option)
Creates or updates global option.
virtual SharedNetwork4Collection getModifiedSharedNetworks4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const
Retrieves shared networks modified after specified time.
virtual uint64_t deleteOption4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)
Deletes global option.
virtual OptionDefContainer getModifiedOptionDefs4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const
Retrieves option definitions modified after specified time.
virtual uint64_t deleteAllSubnets4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all subnets.
virtual uint64_t deleteSharedNetwork4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name)
Deletes shared network by name.
virtual OptionDefinitionPtr getOptionDef4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space) const
Retrieves single option definition by code and space.
virtual SharedNetwork4Ptr getSharedNetwork4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name) const
Retrieves shared network by name.
virtual uint64_t deleteAllSharedNetworks4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all shared networks.
virtual void createUpdateSharedNetwork4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const SharedNetwork4Ptr &shared_network)
Creates or updates a shared network.
virtual void createUpdateOptionDef4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const OptionDefinitionPtr &option_def)
Creates or updates an option definition.
virtual data::StampedValuePtr getGlobalParameter4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name) const
Retrieves global parameter value.
virtual void createUpdateGlobalParameter4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const data::StampedValuePtr &value)
Creates or updates global string parameter.
virtual uint64_t deleteOptionDef4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)
Deletes option definition.
virtual Subnet4Collection getAllSubnets4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all subnets.
virtual uint64_t deleteSubnet4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &subnet_prefix)
Deletes subnet by prefix.
virtual OptionContainer getAllOptions4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all global options.
virtual data::StampedValueCollection getModifiedGlobalParameters4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const
Retrieves global parameters modified after specified time.
virtual uint64_t deleteAllOptionDefs4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all option definitions.
virtual OptionDescriptorPtr getOption4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space) const
Retrieves single option by code and space.
virtual Subnet4Ptr getSubnet4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &subnet_prefix) const
Retrieves a single subnet by subnet_prefix.
virtual OptionDefContainer getAllOptionDefs4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all option definitions.
virtual uint64_t deleteGlobalParameter4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name)
Deletes global parameter.
virtual OptionContainer getModifiedOptions4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const
Retrieves option modified after specified time.
virtual SharedNetwork4Collection getAllSharedNetworks4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all shared networks.
virtual uint64_t deleteAllGlobalParameters4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all global parameters.
virtual void createUpdateSubnet4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const Subnet4Ptr &subnet)
Creates or updates a subnet.
virtual Subnet4Collection getModifiedSubnets4(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const
Retrieves subnets modified after specified time.
boost::shared_ptr< StampedValue > StampedValuePtr
Pointer to the stamped value.
Definition: stamped_value.h:21
std::vector< StampedValuePtr > StampedValueCollection
Collection of pointers to values.
Definition: stamped_value.h:24
boost::multi_index_container< SharedNetwork4Ptr, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< SharedNetworkRandomAccessIndexTag > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SharedNetworkNameIndexTag >, boost::multi_index::const_mem_fun< SharedNetwork4, std::string, &SharedNetwork4::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SharedNetworkServerIdIndexTag >, boost::multi_index::const_mem_fun< Network4, asiolink::IOAddress, &Network4::getServerId > > > > SharedNetwork4Collection
Multi index container holding shared networks.
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition: subnet.h:464
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
boost::multi_index_container< OptionDescriptor, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< KeyFromKeyExtractor< boost::multi_index::const_mem_fun< Option, uint16_t, &Option::getType >, boost::multi_index::member< OptionDescriptor, OptionPtr, &OptionDescriptor::option_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::member< OptionDescriptor, bool, &OptionDescriptor::persistent_ > > > > OptionContainer
Multi index container for DHCP option descriptors.
Definition: cfg_option.h:203
boost::shared_ptr< OptionDescriptor > OptionDescriptorPtr
A pointer to option descriptor.
Definition: cfg_option.h:132
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24
boost::multi_index_container< Subnet4Ptr, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< SubnetRandomAccessIndexTag > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetServerIdIndexTag >, boost::multi_index::const_mem_fun< Network4, asiolink::IOAddress, &Network4::getServerId > > > > Subnet4Collection
A collection of Subnet4 objects.
Definition: subnet.h:798
boost::multi_index_container< OptionDefinitionPtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< boost::multi_index::const_mem_fun< OptionDefinition, uint16_t, &OptionDefinition::getCode > >, boost::multi_index::hashed_non_unique< boost::multi_index::const_mem_fun< OptionDefinition, std::string, &OptionDefinition::getName > > > > OptionDefContainer
Multi index container for DHCP option definitions.
boost::shared_ptr< SharedNetwork4 > SharedNetwork4Ptr
Pointer to SharedNetwork4 object.
Defines the logger used by the top-level component of kea-dhcp-ddns.