Kea  1.9.9-git
config_backend_dhcp6.h
Go to the documentation of this file.
1 // Copyright (C) 2019-2021 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_DHCP6_H
8 #define CONFIG_BACKEND_DHCP6_H
9 
10 #include <cc/server_tag.h>
11 #include <cc/stamped_value.h>
13 #include <database/audit_entry.h>
14 #include <database/server.h>
17 #include <dhcp/option.h>
18 #include <dhcp/option_definition.h>
19 #include <dhcpsrv/cfg_option.h>
20 #include <dhcpsrv/shared_network.h>
21 #include <dhcpsrv/subnet.h>
22 #include <boost/shared_ptr.hpp>
23 #include <boost/date_time/posix_time/ptime.hpp>
24 #include <string>
25 
26 namespace isc {
27 namespace dhcp {
28 
87 public:
88 
90  virtual ~ConfigBackendDHCPv6() { }
91 
100  virtual Subnet6Ptr
101  getSubnet6(const db::ServerSelector& server_selector,
102  const std::string& subnet_prefix) const = 0;
103 
112  virtual Subnet6Ptr
113  getSubnet6(const db::ServerSelector& server_selector, const SubnetID& subnet_id) const = 0;
114 
122  virtual Subnet6Collection
123  getAllSubnets6(const db::ServerSelector& server_selector) const = 0;
124 
134  virtual Subnet6Collection
135  getSharedNetworkSubnets6(const db::ServerSelector& server_selector,
136  const std::string& shared_network_name) const = 0;
137 
146  virtual Subnet6Collection
147  getModifiedSubnets6(const db::ServerSelector& server_selector,
148  const boost::posix_time::ptime& modification_time) const = 0;
149 
158  virtual SharedNetwork6Ptr
159  getSharedNetwork6(const db::ServerSelector& server_selector,
160  const std::string& name) const = 0;
161 
171  getAllSharedNetworks6(const db::ServerSelector& server_selector) const = 0;
172 
183  getModifiedSharedNetworks6(const db::ServerSelector& server_selector,
184  const boost::posix_time::ptime& modification_time) const = 0;
185 
195  virtual OptionDefinitionPtr
196  getOptionDef6(const db::ServerSelector& server_selector, const uint16_t code,
197  const std::string& space) const = 0;
198 
207  virtual OptionDefContainer
208  getAllOptionDefs6(const db::ServerSelector& server_selector) const = 0;
209 
220  virtual OptionDefContainer
221  getModifiedOptionDefs6(const db::ServerSelector& server_selector,
222  const boost::posix_time::ptime& modification_time) const = 0;
223 
234  virtual OptionDescriptorPtr
235  getOption6(const db::ServerSelector& server_selector, const uint16_t code,
236  const std::string& space) const = 0;
237 
246  virtual OptionContainer
247  getAllOptions6(const db::ServerSelector& server_selector) const = 0;
248 
258  virtual OptionContainer
259  getModifiedOptions6(const db::ServerSelector& selector,
260  const boost::posix_time::ptime& modification_time) const = 0;
261 
271  virtual data::StampedValuePtr
272  getGlobalParameter6(const db::ServerSelector& selector,
273  const std::string& name) const = 0;
274 
283  getAllGlobalParameters6(const db::ServerSelector& selector) const = 0;
284 
295  const boost::posix_time::ptime& modification_time) const = 0;
296 
310  getRecentAuditEntries(const db::ServerSelector& server_selector,
311  const boost::posix_time::ptime& modification_time,
312  const uint64_t& modification_id) const = 0;
313 
320  virtual db::ServerCollection
321  getAllServers6() const = 0;
322 
328  virtual db::ServerPtr
329  getServer6(const data::ServerTag& server_tag) const = 0;
330 
338  virtual void
339  createUpdateSubnet6(const db::ServerSelector& server_selector,
340  const Subnet6Ptr& subnet) = 0;
341 
349  virtual void
350  createUpdateSharedNetwork6(const db::ServerSelector& server_selector,
351  const SharedNetwork6Ptr& shared_network) = 0;
352 
360  virtual void
361  createUpdateOptionDef6(const db::ServerSelector& server_selector,
362  const OptionDefinitionPtr& option_def) = 0;
363 
371  virtual void
372  createUpdateOption6(const db::ServerSelector& server_selector,
373  const OptionDescriptorPtr& option) = 0;
374 
384  virtual void
385  createUpdateOption6(const db::ServerSelector& selector,
386  const std::string& shared_network_name,
387  const OptionDescriptorPtr& option) = 0;
388 
397  virtual void
398  createUpdateOption6(const db::ServerSelector& server_selector,
399  const SubnetID& subnet_id,
400  const OptionDescriptorPtr& option) = 0;
401 
413  virtual void
414  createUpdateOption6(const db::ServerSelector& server_selector,
415  const asiolink::IOAddress& pool_start_address,
416  const asiolink::IOAddress& pool_end_address,
417  const OptionDescriptorPtr& option) = 0;
418 
430  virtual void
431  createUpdateOption6(const db::ServerSelector& server_selector,
432  const asiolink::IOAddress& pd_pool_prefix,
433  const uint8_t pd_pool_prefix_length,
434  const OptionDescriptorPtr& option) = 0;
435 
443  virtual void
444  createUpdateGlobalParameter6(const db::ServerSelector& server_selector,
445  const data::StampedValuePtr& value) = 0;
446 
450  virtual void
451  createUpdateServer6(const db::ServerPtr& server) = 0;
452 
461  virtual uint64_t
462  deleteSubnet6(const db::ServerSelector& server_selector,
463  const std::string& subnet_prefix) = 0;
464 
473  virtual uint64_t
474  deleteSubnet6(const db::ServerSelector& server_selector, const SubnetID& subnet_id) = 0;
475 
483  virtual uint64_t
484  deleteAllSubnets6(const db::ServerSelector& server_selector) = 0;
485 
495  virtual uint64_t
496  deleteSharedNetworkSubnets6(const db::ServerSelector& server_selector,
497  const std::string& shared_network_name) = 0;
498 
507  virtual uint64_t
508  deleteSharedNetwork6(const db::ServerSelector& server_selector,
509  const std::string& name) = 0;
510 
518  virtual uint64_t
519  deleteAllSharedNetworks6(const db::ServerSelector& server_selector) = 0;
520 
530  virtual uint64_t
531  deleteOptionDef6(const db::ServerSelector& server_selector,
532  const uint16_t code,
533  const std::string& space) = 0;
534 
542  virtual uint64_t
543  deleteAllOptionDefs6(const db::ServerSelector& server_selector) = 0;
544 
554  virtual uint64_t
555  deleteOption6(const db::ServerSelector& server_selector,
556  const uint16_t code,
557  const std::string& space) = 0;
558 
569  virtual uint64_t
570  deleteOption6(const db::ServerSelector& selector,
571  const std::string& shared_network_name,
572  const uint16_t code,
573  const std::string& space) = 0;
574 
586  virtual uint64_t
587  deleteOption6(const db::ServerSelector& server_selector,
588  const SubnetID& subnet_id,
589  const uint16_t code,
590  const std::string& space) = 0;
591 
605  virtual uint64_t
606  deleteOption6(const db::ServerSelector& server_selector,
607  const asiolink::IOAddress& pool_start_address,
608  const asiolink::IOAddress& pool_end_address,
609  const uint16_t code,
610  const std::string& space) = 0;
611 
625  virtual uint64_t
626  deleteOption6(const db::ServerSelector& server_selector,
627  const asiolink::IOAddress& pd_pool_prefix,
628  const uint8_t pd_pool_prefix_length,
629  const uint16_t code,
630  const std::string& space) = 0;
631 
640  virtual uint64_t
641  deleteGlobalParameter6(const db::ServerSelector& server_selector,
642  const std::string& name) = 0;
643 
651  virtual uint64_t
652  deleteAllGlobalParameters6(const db::ServerSelector& server_selector) = 0;
653 
658  virtual uint64_t
659  deleteServer6(const data::ServerTag& server_tag) = 0;
660 
665  virtual uint64_t
666  deleteAllServers6() = 0;
667 };
668 
670 typedef boost::shared_ptr<ConfigBackendDHCPv6> ConfigBackendDHCPv6Ptr;
671 
672 } // end of namespace isc::dhcp
673 } // end of namespace isc
674 
675 #endif // CONFIG_BACKEND_DHCP6_H
virtual uint64_t deleteSubnet6(const db::ServerSelector &server_selector, const std::string &subnet_prefix)=0
Deletes subnet by prefix.
virtual data::StampedValueCollection getModifiedGlobalParameters6(const db::ServerSelector &selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves global parameters modified after specified time.
virtual Subnet6Collection getModifiedSubnets6(const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves subnets modified after specified time.
Interface for Kea server specific configuration backend implementations.
virtual SharedNetwork6Ptr getSharedNetwork6(const db::ServerSelector &server_selector, const std::string &name) const =0
Retrieves shared network by name.
virtual data::StampedValuePtr getGlobalParameter6(const db::ServerSelector &selector, const std::string &name) const =0
Retrieves global parameter value.
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 OptionDefinitionPtr getOptionDef6(const db::ServerSelector &server_selector, const uint16_t code, const std::string &space) const =0
Retrieves single option definition by code and space.
virtual OptionDefContainer getModifiedOptionDefs6(const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves option definitions modified after specified time.
virtual void createUpdateOption6(const db::ServerSelector &server_selector, const OptionDescriptorPtr &option)=0
Creates or updates global option.
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 db::AuditEntryCollection getRecentAuditEntries(const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time, const uint64_t &modification_id) const =0
Retrieves the most recent audit entries.
virtual uint64_t deleteSharedNetworkSubnets6(const db::ServerSelector &server_selector, const std::string &shared_network_name)=0
Deletes all subnets belonging to a specified shared network.
virtual uint64_t deleteAllSharedNetworks6(const db::ServerSelector &server_selector)=0
Deletes all shared networks.
virtual void createUpdateSharedNetwork6(const db::ServerSelector &server_selector, const SharedNetwork6Ptr &shared_network)=0
Creates or updates a shared network.
virtual uint64_t deleteAllGlobalParameters6(const db::ServerSelector &server_selector)=0
Deletes all global parameters.
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.
Interface implemented by DHCPv6 configuration backends.
virtual OptionContainer getAllOptions6(const db::ServerSelector &server_selector) const =0
Retrieves all global options.
virtual void createUpdateServer6(const db::ServerPtr &server)=0
Creates or updates a server.
Represents a server tag.
Definition: server_tag.h:25
virtual Subnet6Collection getSharedNetworkSubnets6(const db::ServerSelector &server_selector, const std::string &shared_network_name) const =0
Retrieves all subnets belonging to a specified shared network.
virtual SharedNetwork6Collection getAllSharedNetworks6(const db::ServerSelector &server_selector) const =0
Retrieves all shared networks.
virtual void createUpdateGlobalParameter6(const db::ServerSelector &server_selector, const data::StampedValuePtr &value)=0
Creates or updates global parameter.
virtual uint64_t deleteOptionDef6(const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)=0
Deletes option definition.
virtual db::ServerCollection getAllServers6() const =0
Retrieves all servers.
virtual ~ConfigBackendDHCPv6()
Virtual destructor.
virtual uint64_t deleteGlobalParameter6(const db::ServerSelector &server_selector, const std::string &name)=0
Deletes global parameter.
virtual void createUpdateSubnet6(const db::ServerSelector &server_selector, const Subnet6Ptr &subnet)=0
Creates or updates a subnet.
virtual uint64_t deleteAllServers6()=0
Deletes all servers from the backend except the logical server 'all'.
virtual void createUpdateOptionDef6(const db::ServerSelector &server_selector, const OptionDefinitionPtr &option_def)=0
Creates or updates an option definition.
Server selector for associating objects in a database with specific servers.
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
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
virtual OptionContainer getModifiedOptions6(const db::ServerSelector &selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves options modified after specified time.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual Subnet6Ptr getSubnet6(const db::ServerSelector &server_selector, const std::string &subnet_prefix) const =0
Retrieves a single subnet by subnet_prefix.
virtual uint64_t deleteServer6(const data::ServerTag &server_tag)=0
Deletes a server from the backend.
virtual SharedNetwork6Collection getModifiedSharedNetworks6(const db::ServerSelector &server_selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves shared networks 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.
virtual uint64_t deleteAllSubnets6(const db::ServerSelector &server_selector)=0
Deletes all subnets.
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< ConfigBackendDHCPv6 > ConfigBackendDHCPv6Ptr
Shared pointer to the ConfigBackendDHCPv6 instance.
virtual OptionDefContainer getAllOptionDefs6(const db::ServerSelector &server_selector) const =0
Retrieves all option definitions.
virtual OptionDescriptorPtr getOption6(const db::ServerSelector &server_selector, const uint16_t code, const std::string &space) const =0
Retrieves single option by code and space.
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Definition: subnet.h:670
virtual uint64_t deleteAllOptionDefs6(const db::ServerSelector &server_selector)=0
Deletes all option definitions.
virtual uint64_t deleteOption6(const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)=0
Deletes global option.
virtual uint64_t deleteSharedNetwork6(const db::ServerSelector &server_selector, const std::string &name)=0
Deletes shared network by name.
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 Subnet6Collection getAllSubnets6(const db::ServerSelector &server_selector) const =0
Retrieves all subnets.
virtual db::ServerPtr getServer6(const data::ServerTag &server_tag) const =0
Retrieves a server.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24
virtual data::StampedValueCollection getAllGlobalParameters6(const db::ServerSelector &selector) const =0
Retrieves all global parameters.