![]() |
Kea 3.1.1
|
Implements the logic for processing commands pertaining to subnets manipulation. More...
#include <subnet_cmds.h>
Public Member Functions | |
SubnetCmds () | |
Constructor. | |
data::ConstElementPtr | addNetwork4 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network4-add' command. | |
data::ConstElementPtr | addNetwork4Subnet (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network4-subnet-add' command. | |
data::ConstElementPtr | addNetwork6 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network6-add' command. | |
data::ConstElementPtr | addNetwork6Subnet (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network6-subnet-add' command. | |
data::ConstElementPtr | addSubnet4 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet4-add' command. | |
data::ConstElementPtr | addSubnet4Delta (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet4-delta-add' command. | |
data::ConstElementPtr | addSubnet6 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet6-add' command. | |
data::ConstElementPtr | addSubnet6Delta (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet6-delta-add' command. | |
data::ConstElementPtr | delNetwork4 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network4-del' command. | |
data::ConstElementPtr | delNetwork4Subnet (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network4-subnet-del' command. | |
data::ConstElementPtr | delNetwork6 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network6-del' command. | |
data::ConstElementPtr | delNetwork6Subnet (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'network6-subnet-del' command. | |
data::ConstElementPtr | delSubnet4 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet4-del' command. | |
data::ConstElementPtr | delSubnet4Delta (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet4-delta-del' command. | |
data::ConstElementPtr | delSubnet6 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet6-del' command. | |
data::ConstElementPtr | delSubnet6Delta (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet6-delta-del' command. | |
data::ConstElementPtr | getNetwork4 (const data::ConstElementPtr &arguments) const |
Returns a response to 'network4-get' command. | |
data::ConstElementPtr | getNetwork4List () const |
Returns a response to a 'network4-list' command. | |
data::ConstElementPtr | getNetwork6 (const data::ConstElementPtr &arguments) const |
Returns a response to 'network6-get' command. | |
data::ConstElementPtr | getNetwork6List () const |
Returns a response to a 'network6-list' command. | |
data::ConstElementPtr | getSubnet4 (const data::ConstElementPtr &arguments) const |
Returns a response to 'subnet4-get' command. | |
data::ConstElementPtr | getSubnet4List () const |
Returns a response to a 'subnet4-list' command. | |
data::ConstElementPtr | getSubnet6 (const data::ConstElementPtr &arguments) const |
Returns a response to 'subnet6-get' command. | |
data::ConstElementPtr | getSubnet6List () const |
Returns a response to a 'subnet6-list' command. | |
data::ConstElementPtr | updateSubnet4 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet4-update' command. | |
data::ConstElementPtr | updateSubnet6 (const data::ConstElementPtr &arguments) |
Processes and returns a response to 'subnet6-update' command. | |
Implements the logic for processing commands pertaining to subnets manipulation.
This class is used by the callouts implementing command handlers for subnets manipulations.
Definition at line 25 of file subnet_cmds.h.
isc::subnet_cmds::SubnetCmds::SubnetCmds | ( | ) |
Constructor.
It creates an instance of the SubnetCmdsImpl
.
Definition at line 1561 of file subnet_cmds.cc.
ConstElementPtr isc::subnet_cmds::SubnetCmds::addNetwork4 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network4-add' command.
Modifying shared network configuration requires a critical section.
This function processes 'network4-add' command by adding specified shared network (with zero or more subnets in it) to the current server configuration and returns a response to the client.
The command has the following structure:
Before adding the subnet to the current configuration this method will check for duplicated subnet, i.e. having the same id or subnet prefix. If the subnet duplicates an existing subnets an exception is thrown. The exception is also thrown when any other error occurs.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1720 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addNetwork4Subnet | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network4-subnet-add' command.
This function processes the 'network4-subnet-add' command by searching for a subnet with specified id and a network with specified name and then adding the subnet to that network.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1754 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addNetwork6 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network6-add' command.
This function processes 'network6-add' command by adding specified shared network (with zero or more subnets in it) to the current server configuration and returns a response to the client.
The command has the following structure:
Before adding the subnet to the current configuration this method will check for duplicated subnet, i.e. having the same id or subnet prefix. If the subnet duplicates an existing subnets an exception is thrown. The exception is also thrown when any other error occurs.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1729 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addNetwork6Subnet | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network6-subnet-add' command.
This function processes the 'network6-subnet-add' command by searching for a subnet with specified id and a network with specified name and then adding the subnet to that network.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1763 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addSubnet4 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet4-add' command.
Modifying subnet configuration requires a critical section.
This function processes 'subnet4-add' command by adding it to the current server configuration and returns a response to the client.
The command has the following structure:
Before adding the subnet to the current configuration this method will check for duplicated subnet, i.e. having the same id or subnet prefix. If the subnet duplicates an existing subnets an exception is thrown. The exception is also thrown when any other error occurs.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1594 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addSubnet4Delta | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet4-delta-add' command.
This function processes 'subnet4-delta-add' command by adding the specified parameters to the existing subnet already present in the current server configuration and returns a response to the client.
The command has the following structure:
Before updating the subnet in the current configuration this method will check for existing subnet with the same id and update it by adding the configuration delta. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1646 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), and isc::subnet_cmds::UPDATE_DELTA_ADD.
ConstElementPtr isc::subnet_cmds::SubnetCmds::addSubnet6 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet6-add' command.
This function processes 'subnet6-add' command by adding it to the current server configuration and returns a response to the client.
The command has the following structure:
Before adding the subnet to the current configuration this method will check for duplicated subnet, i.e. having the same id or subnet prefix. If the subnet duplicates an existing subnets an exception is thrown. The exception is also thrown when any other error occurs.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1603 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::addSubnet6Delta | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet6-delta-add' command.
This function processes 'subnet6-delta-add' command by adding the specified parameters to the existing subnet already present in the current server configuration and returns a response to the client.
The command has the following structure:
Before updating the subnet in the current configuration this method will check for existing subnet with the same id and update it by adding the configuration delta. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1657 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), and isc::subnet_cmds::UPDATE_DELTA_ADD.
ConstElementPtr isc::subnet_cmds::SubnetCmds::delNetwork4 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network4-del' command.
This function processes the 'network4-del' command by searching for a subnet by specified name and deleting this shared network from the server configuration. The subnets in this shared network will not be deleted, but instead will be degraded to regular, plain subnets.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1738 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delNetwork4Subnet | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network4-subnet-del' command.
This function processes the 'network4-subnet-del' command by searching for a subnet with specified id within a network with specified name and then removing the subnet from that network.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1772 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delNetwork6 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network6-del' command.
This function processes the 'network6-del' command by searching for a subnet by specified name and deleting this shared network from the server configuration. The subnets in this shared network will not be deleted, but instead will be degraded to regular, plain subnets.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1746 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delNetwork6Subnet | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'network6-subnet-del' command.
This function processes the 'network6-subnet-del' command by searching for a subnet with specified id within a network with specified name and then removing the subnet from that network.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1779 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delSubnet4 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet4-del' command.
This function processes the 'subnet4-del' command by searching for a subnet by specified id and deleting this subnet from the server configuration.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1632 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delSubnet4Delta | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet4-delta-del' command.
This function processes 'subnet4-delta-add' command by removing the specified parameters from the existing subnet already present in the current server configuration and returns a response to the client.
The command has the following structure:
Before updating the subnet in the current configuration this method will check for existing subnet with the same id and update it by removing the configuration delta. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1668 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), and isc::subnet_cmds::UPDATE_DELTA_DEL.
ConstElementPtr isc::subnet_cmds::SubnetCmds::delSubnet6 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet6-del' command.
This function processes the 'subnet6-del' command by searching for a subnet by specified id and deleting this subnet from the server configuration.
The command has the following structure:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1639 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::delSubnet6Delta | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet6-delta-del' command.
This function processes 'subnet6-delta-del' command by removing the specified parameters from the existing subnet already present in the current server configuration and returns a response to the client.
The command has the following structure:
Before updating the subnet in the current configuration this method will check for existing subnet with the same id and update it by removing the configuration delta. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1679 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), and isc::subnet_cmds::UPDATE_DELTA_DEL.
ConstElementPtr isc::subnet_cmds::SubnetCmds::getNetwork4 | ( | const data::ConstElementPtr & | arguments | ) | const |
Returns a response to 'network4-get' command.
This function returns an IPv4 shared network by a specified parameter. Currently the only supported parameter is:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a response to the command. BadValue | if the arguments are invalid |
Definition at line 1706 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getNetwork4List | ( | ) | const |
Returns a response to a 'network4-list' command.
This method retrieves configured IPv4 shared networks and returns them within a command response. The successful response has the following structure:
isc::data::Element
object holding the data structure reflecting a response to the command. Definition at line 1694 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getNetwork6 | ( | const data::ConstElementPtr & | arguments | ) | const |
Returns a response to 'network6-get' command.
This function returns an IPv6 shared network by a specified parameter. Currently the only supported parameter is:
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a response to the command. BadValue | if the arguments are invalid |
Definition at line 1712 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getNetwork6List | ( | ) | const |
Returns a response to a 'network6-list' command.
This method retrieves configured IPv6 shared networks and returns them within a command response. The successful response has the following structure:
isc::data::Element
object holding the data structure reflecting a response to the command. Definition at line 1700 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getSubnet4 | ( | const data::ConstElementPtr & | arguments | ) | const |
Returns a response to 'subnet4-get' command.
This function returns an IPv4 subnet by a specified parameter. Currently supported parameters are:
Only one of those parameters can be specified.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a response to the command. BadValue | if the arguments are invalid or if no subnet found. |
Definition at line 1578 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getSubnet4List | ( | ) | const |
Returns a response to a 'subnet4-list' command.
This method retrieves configured IPv4 subnets and returns them within a command response. The successful response has the following structure:
isc::data::Element
object holding the data structure reflecting a response to the command. Definition at line 1566 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getSubnet6 | ( | const data::ConstElementPtr & | arguments | ) | const |
Returns a response to 'subnet6-get' command.
This function returns an IPv6 subnet by a specified parameter. Currently supported parameters are:
Only one of those parameters can be specified.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a response to the command. BadValue | if the arguments are invalid or if no subnet found. |
Definition at line 1585 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::getSubnet6List | ( | ) | const |
Returns a response to a 'subnet6-list' command.
This method retrieves configured IPv6 subnets and returns them within a command response. The successful response has the following structure:
isc::data::Element
object holding the data structure reflecting a response to the command. Definition at line 1572 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::updateSubnet4 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet4-update' command.
This function processes 'subnet4-update' command by replacing it in the current server configuration and returns a response to the client.
The command has the following structure:
Before replacing the subnet in the current configuration this method will check for existing subnet with the same id and update it by this new subnet. The prefix should not be updated but this case is supported. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1612 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
ConstElementPtr isc::subnet_cmds::SubnetCmds::updateSubnet6 | ( | const data::ConstElementPtr & | arguments | ) |
Processes and returns a response to 'subnet6-update' command.
This function processes 'subnet6-update' command by replacing existing subnet with a new subnet in the current server configuration and returns a response to the client.
The command has the following structure:
Before replacing the subnet in the current configuration this method will check for existing subnet with the same id and update it by this new subnet. The prefix should not be updated but this case is supported. The operation is atomic: either it succeeds or it fails leaving the configuration unchanged and throwing an exception.
The successful response has the following structure:
arguments | Arguments received for the command. |
isc::data::Element
object holding the data structure reflecting a successful response to the command. Definition at line 1622 of file subnet_cmds.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().