Kea  1.9.9-git
config_backend_pool_dhcp6.h
Go to the documentation of this file.
1 // Copyright (C) 2019-2020 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_DHCP6_H
8 #define CONFIG_BACKEND_POOL_DHCP6_H
9 
10 #include <cc/server_tag.h>
11 #include <cc/stamped_value.h>
15 #include <dhcp/option.h>
16 #include <dhcp/option_definition.h>
17 #include <dhcpsrv/cfg_option.h>
19 #include <dhcpsrv/shared_network.h>
20 #include <dhcpsrv/subnet.h>
21 #include <boost/date_time/posix_time/ptime.hpp>
22 #include <string>
23 
24 namespace isc {
25 namespace dhcp {
26 
31 class ConfigBackendPoolDHCPv6 : public cb::BaseConfigBackendPool<ConfigBackendDHCPv6> {
32 public:
33 
40  virtual Subnet6Ptr
41  getSubnet6(const db::BackendSelector& backend_selector,
42  const db::ServerSelector& server_selector,
43  const std::string& subnet_prefix) const;
44 
51  virtual Subnet6Ptr
52  getSubnet6(const db::BackendSelector& backend_selector,
53  const db::ServerSelector& server_selector,
54  const SubnetID& subnet_id) const;
55 
61  virtual Subnet6Collection
62  getAllSubnets6(const db::BackendSelector& backend_selector,
63  const db::ServerSelector& server_selector) const;
64 
71  virtual Subnet6Collection
72  getModifiedSubnets6(const db::BackendSelector& backend_selector,
73  const db::ServerSelector& server_selector,
74  const boost::posix_time::ptime& modification_time) const;
75 
83  virtual Subnet6Collection
84  getSharedNetworkSubnets6(const db::BackendSelector& backend_selector,
85  const db::ServerSelector& server_selector,
86  const std::string& shared_network_name) const;
87 
94  virtual SharedNetwork6Ptr
95  getSharedNetwork6(const db::BackendSelector& backend_selector,
96  const db::ServerSelector& server_selector,
97  const std::string& name) const;
98 
106  getAllSharedNetworks6(const db::BackendSelector& backend_selector,
107  const db::ServerSelector& server_selector) const;
108 
117  getModifiedSharedNetworks6(const db::BackendSelector& backend_selector,
118  const db::ServerSelector& server_selector,
119  const boost::posix_time::ptime& modification_time) const;
120 
128  virtual OptionDefinitionPtr
129  getOptionDef6(const db::BackendSelector& backend_selector,
130  const db::ServerSelector& server_selector,
131  const uint16_t code,
132  const std::string& space) const;
133 
140  virtual OptionDefContainer
141  getAllOptionDefs6(const db::BackendSelector& backend_selector,
142  const db::ServerSelector& server_selector) const;
143 
152  virtual OptionDefContainer
153  getModifiedOptionDefs6(const db::BackendSelector& backend_selector,
154  const db::ServerSelector& server_selector,
155  const boost::posix_time::ptime& modification_time) const;
156 
165  virtual OptionDescriptorPtr
166  getOption6(const db::BackendSelector& backend_selector,
167  const db::ServerSelector& server_selector,
168  const uint16_t code,
169  const std::string& space) const;
170 
177  virtual OptionContainer
178  getAllOptions6(const db::BackendSelector& backend_selector,
179  const db::ServerSelector& server_selector) const;
180 
188  virtual OptionContainer
189  getModifiedOptions6(const db::BackendSelector& backend_selector,
190  const db::ServerSelector& server_selector,
191  const boost::posix_time::ptime& modification_time) const;
192 
199  virtual data::StampedValuePtr
200  getGlobalParameter6(const db::BackendSelector& backend_selector,
201  const db::ServerSelector& server_selector,
202  const std::string& name) const;
203 
209  getAllGlobalParameters6(const db::BackendSelector& backend_selector,
210  const db::ServerSelector& server_selector) const;
211 
219  getModifiedGlobalParameters6(const db::BackendSelector& backend_selector,
220  const db::ServerSelector& server_selector,
221  const boost::posix_time::ptime& modification_time) const;
222 
234  getRecentAuditEntries(const db::BackendSelector& backend_selector,
235  const db::ServerSelector& server_selector,
236  const boost::posix_time::ptime& modification_time,
237  const uint64_t& modification_id) const;
238 
246  virtual db::ServerCollection
247  getAllServers6(const db::BackendSelector& backend_selector) const;
248 
255  virtual db::ServerPtr
256  getServer6(const db::BackendSelector& backend_selector,
257  const data::ServerTag& server_tag) const;
258 
264  virtual void
265  createUpdateSubnet6(const db::BackendSelector& backend_selector,
266  const db::ServerSelector& server_selector,
267  const Subnet6Ptr& subnet);
268 
274  virtual void
275  createUpdateSharedNetwork6(const db::BackendSelector& backend_selector,
276  const db::ServerSelector& server_selector,
277  const SharedNetwork6Ptr& shared_network);
278 
284  virtual void
285  createUpdateOptionDef6(const db::BackendSelector& backend_selector,
286  const db::ServerSelector& server_selector,
287  const OptionDefinitionPtr& option_def);
288 
294  virtual void
295  createUpdateOption6(const db::BackendSelector& backend_selector,
296  const db::ServerSelector& server_selector,
297  const OptionDescriptorPtr& option);
298 
306  virtual void
307  createUpdateOption6(const db::BackendSelector& backend_selector,
308  const db::ServerSelector& server_selector,
309  const std::string& shared_network_name,
310  const OptionDescriptorPtr& option);
311 
318  virtual void
319  createUpdateOption6(const db::BackendSelector& backend_selector,
320  const db::ServerSelector& server_selector,
321  const SubnetID& subnet_id,
322  const OptionDescriptorPtr& option);
323 
333  virtual void
334  createUpdateOption6(const db::BackendSelector& backend_selector,
335  const db::ServerSelector& server_selector,
336  const asiolink::IOAddress& pool_start_address,
337  const asiolink::IOAddress& pool_end_address,
338  const OptionDescriptorPtr& option);
339 
349  virtual void
350  createUpdateOption6(const db::BackendSelector& backend_selector,
351  const db::ServerSelector& server_selector,
352  const asiolink::IOAddress& pd_pool_prefix,
353  const uint8_t pd_pool_prefix_length,
354  const OptionDescriptorPtr& option);
355 
361  virtual void
362  createUpdateGlobalParameter6(const db::BackendSelector& backend_selector,
363  const db::ServerSelector& server_selector,
364  const data::StampedValuePtr& value);
365 
370  virtual void
371  createUpdateServer6(const db::BackendSelector& backend_selector,
372  const db::ServerPtr& server);
373 
380  virtual uint64_t
381  deleteSubnet6(const db::BackendSelector& backend_selector,
382  const db::ServerSelector& server_selector,
383  const std::string& subnet_prefix);
384 
391  virtual uint64_t
392  deleteSubnet6(const db::BackendSelector& backend_selector,
393  const db::ServerSelector& server_selector,
394  const SubnetID& subnet_id);
395 
401  virtual uint64_t
402  deleteAllSubnets6(const db::BackendSelector& backend_selector,
403  const db::ServerSelector& server_selector);
404 
412  virtual uint64_t
413  deleteSharedNetworkSubnets6(const db::BackendSelector& backend_selector,
414  const db::ServerSelector& server_selector,
415  const std::string& shared_network_name);
416 
423  virtual uint64_t
424  deleteSharedNetwork6(const db::BackendSelector& backend_selector,
425  const db::ServerSelector& server_selector,
426  const std::string& name);
427 
433  virtual uint64_t
434  deleteAllSharedNetworks6(const db::BackendSelector& backend_selector,
435  const db::ServerSelector& server_selector);
436 
444  virtual uint64_t
445  deleteOptionDef6(const db::BackendSelector& backend_selector,
446  const db::ServerSelector& server_selector,
447  const uint16_t code,
448  const std::string& space);
449 
455  virtual uint64_t
456  deleteAllOptionDefs6(const db::BackendSelector& backend_selector,
457  const db::ServerSelector& server_selector);
458 
466  virtual uint64_t
467  deleteOption6(const db::BackendSelector& backend_selector,
468  const db::ServerSelector& server_selector,
469  const uint16_t code,
470  const std::string& space);
471 
480  virtual uint64_t
481  deleteOption6(const db::BackendSelector& backend_selector,
482  const db::ServerSelector& server_selector,
483  const std::string& shared_network_name,
484  const uint16_t code,
485  const std::string& space);
486 
496  virtual uint64_t
497  deleteOption6(const db::BackendSelector& backend_selector,
498  const db::ServerSelector& server_selector,
499  const SubnetID& subnet_id,
500  const uint16_t code, const std::string& space);
501 
513  virtual uint64_t
514  deleteOption6(const db::BackendSelector& backend_selector,
515  const db::ServerSelector& server_selector,
516  const asiolink::IOAddress& pool_start_address,
517  const asiolink::IOAddress& pool_end_address,
518  const uint16_t code,
519  const std::string& space);
520 
532  virtual uint64_t
533  deleteOption6(const db::BackendSelector& backend_selector,
534  const db::ServerSelector& server_selector,
535  const asiolink::IOAddress& pd_pool_prefix,
536  const uint8_t pd_pool_prefix_length,
537  const uint16_t code,
538  const std::string& space);
539 
546  virtual uint64_t
547  deleteGlobalParameter6(const db::BackendSelector& backend_selector,
548  const db::ServerSelector& server_selector,
549  const std::string& name);
550 
556  virtual uint64_t
557  deleteAllGlobalParameters6(const db::BackendSelector& backend_selector,
558  const db::ServerSelector& server_selector);
559 
565  virtual uint64_t
566  deleteServer6(const db::BackendSelector& backend_selector,
567  const data::ServerTag& server_tag);
568 
574  virtual uint64_t
575  deleteAllServers6(const db::BackendSelector& backend_selector);
576 };
577 
578 
579 } // end of namespace isc::dhcp
580 } // end of namespace isc
581 
582 #endif // CONFIG_BACKEND_POOL_DHCP6_H
virtual OptionContainer getModifiedOptions6(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 db::AuditEntryCollection getRecentAuditEntries(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time, const uint64_t &modification_id) const
Retrieves the most recent audit entries.
virtual uint64_t deleteSharedNetworkSubnets6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &shared_network_name)
Deletes all subnets belonging to a specified shared network.
boost::shared_ptr< OptionDescriptor > OptionDescriptorPtr
A pointer to option descriptor.
Definition: cfg_option.h:31
boost::shared_ptr< StampedValue > StampedValuePtr
Pointer to the stamped value.
Definition: stamped_value.h:23
virtual SharedNetwork6Ptr getSharedNetwork6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name) const
Retrieves shared network by name.
boost::shared_ptr< Server > ServerPtr
Shared pointer to the Server class.
Definition: server.h:19
boost::multi_index_container< ServerPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< ServerTagIndexTag >, boost::multi_index::const_mem_fun< Server, std::string,&Server::getServerTagAsText > > >> ServerCollection
Multi index container for Server.
virtual uint64_t deleteSubnet6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &subnet_prefix)
Deletes subnet by prefix.
virtual SharedNetwork6Collection getAllSharedNetworks6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all shared networks.
virtual void createUpdateGlobalParameter6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const data::StampedValuePtr &value)
Creates or updates global string parameter.
virtual uint64_t deleteGlobalParameter6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name)
Deletes global parameter.
virtual OptionDefContainer getModifiedOptionDefs6(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 void createUpdateServer6(const db::BackendSelector &backend_selector, const db::ServerPtr &server)
Creates or updates a server.
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 > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime,&data::StampedElement::getModificationTime > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< OptionIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t,&data::BaseStampedElement::getId > > >> OptionDefContainer
Multi index container for DHCP option definitions.
Implementation of the Configuration Backend Pool for DHCPv6.
virtual uint64_t deleteAllSharedNetworks6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all shared networks.
virtual SharedNetwork6Collection getModifiedSharedNetworks6(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 deleteAllGlobalParameters6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all global parameters.
virtual uint64_t deleteOption6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)
Deletes global option.
virtual data::StampedValueCollection getModifiedGlobalParameters6(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.
Represents a server tag.
Definition: server_tag.h:25
virtual db::ServerPtr getServer6(const db::BackendSelector &backend_selector, const data::ServerTag &server_tag) const
Retrieves a server from the particular backend.
virtual data::StampedValuePtr getGlobalParameter6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name) const
Retrieves global parameter value.
virtual OptionDescriptorPtr getOption6(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.
Server selector for associating objects in a database with specific servers.
virtual uint64_t deleteAllServers6(const db::BackendSelector &backend_selector)
Deletes all servers from the backend except the logical server 'all'.
virtual Subnet6Collection getSharedNetworkSubnets6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &shared_network_name) const
Retrieves all subnets belonging to a specified shared network.
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
Base class for configuration backend pools.
virtual Subnet6Collection getAllSubnets6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all subnets.
boost::multi_index_container< SharedNetwork6Ptr, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< SharedNetworkRandomAccessIndexTag > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< SharedNetworkIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t,&data::BaseStampedElement::getId > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SharedNetworkNameIndexTag >, boost::multi_index::const_mem_fun< SharedNetwork6, std::string,&SharedNetwork6::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SharedNetworkModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime,&data::BaseStampedElement::getModificationTime > > >> SharedNetwork6Collection
Multi index container holding shared networks.
boost::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< 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< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime,&data::BaseStampedElement::getModificationTime > > >> Subnet6Collection
A collection of Subnet6 objects.
Definition: subnet.h:914
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual Subnet6Collection getModifiedSubnets6(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::multi_index_container< StampedValuePtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< StampedValueNameIndexTag >, boost::multi_index::const_mem_fun< StampedValue, std::string,&StampedValue::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< StampedValueModificationTimeIndexTag >, boost::multi_index::const_mem_fun< BaseStampedElement, boost::posix_time::ptime,&BaseStampedElement::getModificationTime > > >> StampedValueCollection
Multi index container for StampedValue.
Config Backend selector.
virtual db::ServerCollection getAllServers6(const db::BackendSelector &backend_selector) const
Retrieves all servers from the particular backend.
virtual void createUpdateSharedNetwork6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const SharedNetwork6Ptr &shared_network)
Creates or updates a shared network.
virtual uint64_t deleteSharedNetwork6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &name)
Deletes shared network by name.
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_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime,&data::BaseStampedElement::getModificationTime > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< OptionIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t,&data::BaseStampedElement::getId > > >> OptionContainer
Multi index container for DHCP option descriptors.
Definition: cfg_option.h:269
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
virtual uint64_t deleteServer6(const db::BackendSelector &backend_selector, const data::ServerTag &server_tag)
Deletes a server from the backend.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Definition: subnet.h:670
virtual uint64_t deleteAllSubnets6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all subnets.
virtual uint64_t deleteOptionDef6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)
Deletes option definition.
virtual uint64_t deleteAllOptionDefs6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector)
Deletes all option definitions.
virtual void createUpdateOption6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const OptionDescriptorPtr &option)
Creates or updates global option.
virtual OptionDefContainer getAllOptionDefs6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all option definitions.
virtual OptionContainer getAllOptions6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all global options.
virtual Subnet6Ptr getSubnet6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const std::string &subnet_prefix) const
Retrieves a single subnet by subnet_prefix.
boost::multi_index_container< AuditEntryPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< AuditEntryObjectTypeTag >, boost::multi_index::composite_key< AuditEntry, boost::multi_index::const_mem_fun< AuditEntry, std::string,&AuditEntry::getObjectType >, boost::multi_index::const_mem_fun< AuditEntry, AuditEntry::ModificationType,&AuditEntry::getModificationType > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< AuditEntryModificationTimeIdTag >, boost::multi_index::composite_key< AuditEntry, boost::multi_index::const_mem_fun< AuditEntry, boost::posix_time::ptime,&AuditEntry::getModificationTime >, boost::multi_index::const_mem_fun< AuditEntry, uint64_t,&AuditEntry::getRevisionId > > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< AuditEntryObjectIdTag >, boost::multi_index::const_mem_fun< AuditEntry, uint64_t,&AuditEntry::getObjectId > > >> AuditEntryCollection
Multi index container holding AuditEntry instances.
Definition: audit_entry.h:291
virtual OptionDefinitionPtr getOptionDef6(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 data::StampedValueCollection getAllGlobalParameters6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector) const
Retrieves all global parameters.
virtual void createUpdateSubnet6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const Subnet6Ptr &subnet)
Creates or updates a subnet.
virtual void createUpdateOptionDef6(const db::BackendSelector &backend_selector, const db::ServerSelector &server_selector, const OptionDefinitionPtr &option_def)
Creates or updates an option definition.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24