Kea  2.1.7-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>
21 #include <dhcpsrv/shared_network.h>
22 #include <dhcpsrv/subnet.h>
23 #include <boost/shared_ptr.hpp>
24 #include <boost/date_time/posix_time/ptime.hpp>
25 #include <string>
26 
27 namespace isc {
28 namespace dhcp {
29 
88 public:
89 
91  virtual ~ConfigBackendDHCPv6() { }
92 
101  virtual Subnet6Ptr
102  getSubnet6(const db::ServerSelector& server_selector,
103  const std::string& subnet_prefix) const = 0;
104 
113  virtual Subnet6Ptr
114  getSubnet6(const db::ServerSelector& server_selector, const SubnetID& subnet_id) const = 0;
115 
123  virtual Subnet6Collection
124  getAllSubnets6(const db::ServerSelector& server_selector) const = 0;
125 
135  virtual Subnet6Collection
136  getSharedNetworkSubnets6(const db::ServerSelector& server_selector,
137  const std::string& shared_network_name) const = 0;
138 
147  virtual Subnet6Collection
148  getModifiedSubnets6(const db::ServerSelector& server_selector,
149  const boost::posix_time::ptime& modification_time) const = 0;
150 
159  virtual SharedNetwork6Ptr
160  getSharedNetwork6(const db::ServerSelector& server_selector,
161  const std::string& name) const = 0;
162 
172  getAllSharedNetworks6(const db::ServerSelector& server_selector) const = 0;
173 
184  getModifiedSharedNetworks6(const db::ServerSelector& server_selector,
185  const boost::posix_time::ptime& modification_time) const = 0;
186 
196  virtual OptionDefinitionPtr
197  getOptionDef6(const db::ServerSelector& server_selector, const uint16_t code,
198  const std::string& space) const = 0;
199 
208  virtual OptionDefContainer
209  getAllOptionDefs6(const db::ServerSelector& server_selector) const = 0;
210 
221  virtual OptionDefContainer
222  getModifiedOptionDefs6(const db::ServerSelector& server_selector,
223  const boost::posix_time::ptime& modification_time) const = 0;
224 
235  virtual OptionDescriptorPtr
236  getOption6(const db::ServerSelector& server_selector, const uint16_t code,
237  const std::string& space) const = 0;
238 
247  virtual OptionContainer
248  getAllOptions6(const db::ServerSelector& server_selector) const = 0;
249 
259  virtual OptionContainer
260  getModifiedOptions6(const db::ServerSelector& selector,
261  const boost::posix_time::ptime& modification_time) const = 0;
262 
272  virtual data::StampedValuePtr
273  getGlobalParameter6(const db::ServerSelector& selector,
274  const std::string& name) const = 0;
275 
284  getAllGlobalParameters6(const db::ServerSelector& selector) const = 0;
285 
296  const boost::posix_time::ptime& modification_time) const = 0;
297 
303  virtual ClientClassDefPtr
304  getClientClass6(const db::ServerSelector& selector, const std::string& name) const = 0;
305 
310  virtual ClientClassDictionary
311  getAllClientClasses6(const db::ServerSelector& selector) const = 0;
312 
318  virtual ClientClassDictionary
320  const boost::posix_time::ptime& modification_time) const = 0;
321 
335  getRecentAuditEntries(const db::ServerSelector& server_selector,
336  const boost::posix_time::ptime& modification_time,
337  const uint64_t& modification_id) const = 0;
338 
345  virtual db::ServerCollection
346  getAllServers6() const = 0;
347 
353  virtual db::ServerPtr
354  getServer6(const data::ServerTag& server_tag) const = 0;
355 
363  virtual void
364  createUpdateSubnet6(const db::ServerSelector& server_selector,
365  const Subnet6Ptr& subnet) = 0;
366 
374  virtual void
375  createUpdateSharedNetwork6(const db::ServerSelector& server_selector,
376  const SharedNetwork6Ptr& shared_network) = 0;
377 
385  virtual void
386  createUpdateOptionDef6(const db::ServerSelector& server_selector,
387  const OptionDefinitionPtr& option_def) = 0;
388 
396  virtual void
397  createUpdateOption6(const db::ServerSelector& server_selector,
398  const OptionDescriptorPtr& option) = 0;
399 
409  virtual void
410  createUpdateOption6(const db::ServerSelector& selector,
411  const std::string& shared_network_name,
412  const OptionDescriptorPtr& option) = 0;
413 
422  virtual void
423  createUpdateOption6(const db::ServerSelector& server_selector,
424  const SubnetID& subnet_id,
425  const OptionDescriptorPtr& option) = 0;
426 
438  virtual void
439  createUpdateOption6(const db::ServerSelector& server_selector,
440  const asiolink::IOAddress& pool_start_address,
441  const asiolink::IOAddress& pool_end_address,
442  const OptionDescriptorPtr& option) = 0;
443 
455  virtual void
456  createUpdateOption6(const db::ServerSelector& server_selector,
457  const asiolink::IOAddress& pd_pool_prefix,
458  const uint8_t pd_pool_prefix_length,
459  const OptionDescriptorPtr& option) = 0;
460 
468  virtual void
469  createUpdateGlobalParameter6(const db::ServerSelector& server_selector,
470  const data::StampedValuePtr& value) = 0;
471 
480  virtual void
481  createUpdateClientClass6(const db::ServerSelector& server_selector,
482  const ClientClassDefPtr& client_class,
483  const std::string& follow_class_name) = 0;
484 
488  virtual void
489  createUpdateServer6(const db::ServerPtr& server) = 0;
490 
499  virtual uint64_t
500  deleteSubnet6(const db::ServerSelector& server_selector,
501  const std::string& subnet_prefix) = 0;
502 
511  virtual uint64_t
512  deleteSubnet6(const db::ServerSelector& server_selector, const SubnetID& subnet_id) = 0;
513 
521  virtual uint64_t
522  deleteAllSubnets6(const db::ServerSelector& server_selector) = 0;
523 
533  virtual uint64_t
534  deleteSharedNetworkSubnets6(const db::ServerSelector& server_selector,
535  const std::string& shared_network_name) = 0;
536 
545  virtual uint64_t
546  deleteSharedNetwork6(const db::ServerSelector& server_selector,
547  const std::string& name) = 0;
548 
556  virtual uint64_t
557  deleteAllSharedNetworks6(const db::ServerSelector& server_selector) = 0;
558 
568  virtual uint64_t
569  deleteOptionDef6(const db::ServerSelector& server_selector,
570  const uint16_t code,
571  const std::string& space) = 0;
572 
580  virtual uint64_t
581  deleteAllOptionDefs6(const db::ServerSelector& server_selector) = 0;
582 
592  virtual uint64_t
593  deleteOption6(const db::ServerSelector& server_selector,
594  const uint16_t code,
595  const std::string& space) = 0;
596 
607  virtual uint64_t
608  deleteOption6(const db::ServerSelector& selector,
609  const std::string& shared_network_name,
610  const uint16_t code,
611  const std::string& space) = 0;
612 
624  virtual uint64_t
625  deleteOption6(const db::ServerSelector& server_selector,
626  const SubnetID& subnet_id,
627  const uint16_t code,
628  const std::string& space) = 0;
629 
643  virtual uint64_t
644  deleteOption6(const db::ServerSelector& server_selector,
645  const asiolink::IOAddress& pool_start_address,
646  const asiolink::IOAddress& pool_end_address,
647  const uint16_t code,
648  const std::string& space) = 0;
649 
663  virtual uint64_t
664  deleteOption6(const db::ServerSelector& server_selector,
665  const asiolink::IOAddress& pd_pool_prefix,
666  const uint8_t pd_pool_prefix_length,
667  const uint16_t code,
668  const std::string& space) = 0;
669 
678  virtual uint64_t
679  deleteGlobalParameter6(const db::ServerSelector& server_selector,
680  const std::string& name) = 0;
681 
689  virtual uint64_t
690  deleteAllGlobalParameters6(const db::ServerSelector& server_selector) = 0;
691 
697  virtual uint64_t
698  deleteClientClass6(const db::ServerSelector& server_selector,
699  const std::string& name) = 0;
700 
705  virtual uint64_t
706  deleteAllClientClasses6(const db::ServerSelector& server_selector) = 0;
707 
712  virtual uint64_t
713  deleteServer6(const data::ServerTag& server_tag) = 0;
714 
719  virtual uint64_t
720  deleteAllServers6() = 0;
721 };
722 
724 typedef boost::shared_ptr<ConfigBackendDHCPv6> ConfigBackendDHCPv6Ptr;
725 
726 } // end of namespace isc::dhcp
727 } // end of namespace isc
728 
729 #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 deleteAllClientClasses6(const db::ServerSelector &server_selector)=0
Deletes all client classes.
virtual uint64_t deleteAllGlobalParameters6(const db::ServerSelector &server_selector)=0
Deletes all global parameters.
Maintains a list of ClientClassDef&#39;s.
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 ClientClassDictionary getAllClientClasses6(const db::ServerSelector &selector) const =0
Retrieves all client classes.
virtual OptionContainer getAllOptions6(const db::ServerSelector &server_selector) const =0
Retrieves all global options.
virtual void createUpdateClientClass6(const db::ServerSelector &server_selector, const ClientClassDefPtr &client_class, const std::string &follow_class_name)=0
Creates or updates a client class.
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 &#39;all&#39;.
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.
virtual ClientClassDictionary getModifiedClientClasses6(const db::ServerSelector &selector, const boost::posix_time::ptime &modification_time) const =0
Retrieves client classes modified after specified time.
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
boost::shared_ptr< ClientClassDef > ClientClassDefPtr
a pointer to an ClientClassDef
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:964
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-lfc.
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:672
virtual uint64_t deleteAllOptionDefs6(const db::ServerSelector &server_selector)=0
Deletes all option definitions.
virtual ClientClassDefPtr getClientClass6(const db::ServerSelector &selector, const std::string &name) const =0
Retrieves a client class by name.
virtual uint64_t deleteClientClass6(const db::ServerSelector &server_selector, const std::string &name)=0
Deletes a client class.
virtual uint64_t deleteOption6(const db::ServerSelector &server_selector, const uint16_t code, const std::string &space)=0
Deletes global option.
Defines classes for storing client class definitions.
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
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:24
virtual data::StampedValueCollection getAllGlobalParameters6(const db::ServerSelector &selector) const =0
Retrieves all global parameters.