Kea 2.7.5
|
This class holds configuration of shared networks. More...
#include <cfg_shared_networks.h>
Public Member Functions | |
void | add (const SharedNetworkPtrType &network) |
Adds new shared network to the configuration. | |
void | del (const std::string &name) |
Deletes shared network from the configuration. | |
uint64_t | del (const uint64_t id) |
Deletes shared networks from the configuration by id. | |
const SharedNetworkCollection * | getAll () const |
Returns pointer to all configured shared networks. | |
SharedNetworkPtrType | getByName (const std::string &name) const |
Retrieves shared network by name. | |
void | merge (CfgOptionDefPtr cfg_def, CfgSharedNetworks &other) |
Merges specified shared network configuration into this configuration. | |
virtual data::ElementPtr | toElement () const |
Unparses shared networks configuration. | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. | |
Protected Attributes | |
SharedNetworkCollection | networks_ |
Multi index container holding shared networks. | |
This class holds configuration of shared networks.
This is a generic class implementing basic functions such as shared network addition, removal and retrieval. It also dumps configuration in the JSON format.
There are specializations of this class implemented as CfgSharedNetworks4 and CfgSharedNetworks6 for IPv4 and IPv6 cases repspectively.
Type | of the pointer to a shared network, i.e. SharedNetwork4Ptr or SharedNetwork6Ptr. |
Definition at line 35 of file cfg_shared_networks.h.
|
inline |
Adds new shared network to the configuration.
network | Pointer to a network |
isc::BadValue | when name is a duplicate of existing network's name. |
Definition at line 48 of file cfg_shared_networks.h.
References isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::getByName(), isc_throw, and isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
inline |
Deletes shared network from the configuration.
name | Name of the network to be deleted. |
isc::BadValue | if the network can't be found. |
Definition at line 62 of file cfg_shared_networks.h.
References isc_throw, and isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
inline |
Deletes shared networks from the configuration by id.
Note that there are cases when there will be multiple shared networks having the same id (typically id of 0). When configuration backend is in use it sets the unique ids from the database. In cases when the configuration backend is not used, the ids default to 0. Passing the id of 0 would result in deleting all shared networks that were not added via the database.
id | Identifier of the shared networks to be deleted. |
Definition at line 89 of file cfg_shared_networks.h.
References isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
inline |
Returns pointer to all configured shared networks.
Definition at line 38 of file cfg_shared_networks.h.
References isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
inline |
Retrieves shared network by name.
name | Name of the network to be retrieved. |
Definition at line 109 of file cfg_shared_networks.h.
References isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
Referenced by isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::add().
|
inline |
Merges specified shared network configuration into this configuration.
This method merges networks from the other
configuration into this configuration. The general rule is that existing networks are replaced by the networks from other
.
For each network in other
, do the following:
other
configuration. Therefore, the caller must not rely on the data held in the other
object after the call to merge
. Also, the data held in other
must not be modified after the call to merge
because it may affect the merged configuration.cfg_def | set of of user-defined option definitions to use when creating option instances. |
other | the shared network configuration to be merged into this configuration. |
Definition at line 162 of file cfg_shared_networks.h.
References isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
inlinevirtual |
Unparses shared networks configuration.
Implements isc::data::CfgToElement.
Definition at line 122 of file cfg_shared_networks.h.
References isc::data::Element::createList(), and isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_.
|
protected |
Multi index container holding shared networks.
Definition at line 215 of file cfg_shared_networks.h.
Referenced by isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::add(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::del(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::del(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::getAll(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::getByName(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::merge(), and isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::toElement().