![]() |
Kea 3.1.1
|
Implementation of the SubnetCmds
class.
More...
Public Member Functions | |
template<typename SimpleParserType, typename SharedNetworkParserType, typename CfgNetworksType, typename CfgSubnetsType> | |
ConstElementPtr | addNetwork (CfgNetworksType &networks_cfg, CfgSubnetsType &subnets_cfg, const ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) |
Provides a response to a 'network4-add' and 'network6-add' command. | |
template<typename CfgNetworksType, typename CfgSubnetsType> | |
ConstElementPtr | addNetworkSubnet (CfgNetworksType &networks, CfgSubnetsType &subnets, const ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) |
Provides a response to a 'network4-subnet-add' and 'network6-subnet-add' command. | |
template<typename SimpleParserType, typename SubnetConfigParserType, typename CfgType> | |
ConstElementPtr | addSubnet (CfgType &cfg, const ConstElementPtr &arguments, const std::string &command_name, const std::string &subnet_parameter, const std::string &protocol_version) |
Provides a response to a 'subnet4-add' and 'subnet6-add' command. | |
template<typename CfgNetworksType, typename CfgSubnetsType> | |
ConstElementPtr | delNetwork (CfgNetworksType &networks_cfg, CfgSubnetsType &subnets_cfg, const ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) |
Provides a response to a 'network4-del' and 'network6-del' command. | |
template<typename CfgNetworksType> | |
ConstElementPtr | delNetworkSubnet (CfgNetworksType &networks, const ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) |
Provides a response to a 'network4-subnet-del' and 'network6-subnet-del' command. | |
template<typename CfgType, typename SharedNetworkPtrType> | |
ConstElementPtr | delSubnet (CfgType &cfg, const ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) |
Provides a response to a 'subnet4-del' and 'subnet6-del' command. | |
template<typename NetworkTypePtr, typename CfgType> | |
ConstElementPtr | getNetwork (const CfgType &cfg, const data::ConstElementPtr &arguments, const std::string &command_name, const std::string &protocol_version) const |
Provides a response to a 'network4-get' or 'network6-get' command. | |
template<typename CfgType> | |
ConstElementPtr | getNetworkList (const CfgType &networks_cfg, const std::string &protocol_type) const |
Returns a response to a 'network4-list' and 'network6-list' command. | |
template<typename SubnetTypePtr, typename CfgType> | |
ConstElementPtr | getSubnet (const CfgType &cfg, const data::ConstElementPtr &arguments, const std::string &command_name, const std::string &subnet_parameter, const std::string &protocol_version) const |
Provides a response to a 'subnet4-get' or 'subnet6-get' command. | |
template<typename CfgType> | |
ConstElementPtr | getSubnetList (const CfgType &cfg, const std::string &protocol_type) const |
Returns a response to a 'subnet4-list' and 'subnet6-list' command. | |
ElementPtr | subnetToElement (const Subnet &subnet, bool include_shared_network) const |
Returns essential subnet parameters in Element format. | |
template<typename SimpleParserType, typename SubnetConfigParserType, typename SharedNetworkPtrType, typename SubnetTypePtr, typename CfgType> | |
ConstElementPtr | updateSubnet (CfgType &cfg, const ConstElementPtr &arguments, const std::string &command_name, const std::string &subnet_parameter, const std::string &protocol_version, UpdateType type=UPDATE_REPLACE) |
Provides a response to a 'subnet4-update' and 'subnet6-update' command. | |
Implementation of the SubnetCmds
class.
It provides generic functions for subnet manipulations.
Definition at line 318 of file subnet_cmds.cc.
|
inline |
Provides a response to a 'network4-add' and 'network6-add' command.
This method is used for processing 'network4-add' and 'network6-add' commands. It parses received command, adds the network to the current server configuration and provides a response to the controlling client.
networks_cfg | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
subnets_cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr . |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'network4-add' or 'network6-add'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
SimpleParserType | One of the SimpleParser4 or SimpleParser6 |
SharedNetworkParserType | One of the SharedNetwork4Parser or SharedNetwork6Parser . |
CfgNetworksType | One of the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr . |
CfgSubnetsType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr . |
Definition at line 1123 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc_throw, Element::list, LOG_INFO, Element::map, isc::subnet_cmds::subnet_cmds_logger, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_ADD.
|
inline |
Provides a response to a 'network4-subnet-add' and 'network6-subnet-add' command.
This method is used for processing 'network4-subnet-add' and 'network6-subnet-add' commands. It parses received command, adds existing subnet to existing shared network to the current server configuration and provides a response to the controlling client.
networks | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
subnets | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'network4-subnet-add' or 'network6-subnet-add'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
CfgNetworksType | One of the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr |
CfgSubnetsType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr |
Definition at line 1384 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::integer, isc_throw, LOG_INFO, Element::map, Element::string, isc::subnet_cmds::subnet_cmds_logger, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_SUBNET_ADD.
|
inline |
Provides a response to a 'subnet4-add' and 'subnet6-add' command.
This method is used for processing 'subnet4-add' and 'subnet6-add' commands. It parses received command, adds the subnet to the current server configuration and provides a response to the controlling client.
cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'subnet4-add' or 'subnet6-add'. |
subnet_parameter | One of the following: 'subnet4' or 'subnet6'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
SimpleParserType | One of the SimpleParser4 or SimpleParser6 |
SubnetConfigParserType | One of the Subnet4ConfigParser or Subnet6ConfigParser . |
CfgType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr . |
Definition at line 504 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc_throw, Element::list, LOG_INFO, Element::map, isc::subnet_cmds::subnet_cmds_logger, and isc::subnet_cmds::SUBNET_CMDS_SUBNET_ADD.
|
inline |
Provides a response to a 'network4-del' and 'network6-del' command.
networks_cfg | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
subnets_cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr . |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'network4-del' or 'network6-del'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
CfgNetworksType | One of the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr . |
CfgSubnetsType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr . |
Definition at line 1253 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc_throw, LOG_INFO, Element::map, Element::string, isc::subnet_cmds::subnet_cmds_logger, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_DEL.
|
inline |
Provides a response to a 'network4-subnet-del' and 'network6-subnet-del' command.
This method is used for processing 'network4-subnet-del' and 'network6-subnet-del' commands. It parses received command, removes existing subnet from existing shared network in the current server configuration and provides a response to the controlling client.
networks | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'network4-subnet-add' or 'network6-subnet-add'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
CfgNetworksType | One of the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr |
Definition at line 1480 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::integer, isc_throw, LOG_INFO, Element::map, Element::string, isc::subnet_cmds::subnet_cmds_logger, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_SUBNET_DEL.
|
inline |
Provides a response to a 'subnet4-del' and 'subnet6-del' command.
cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'subnet4-del' or 'subnet6-del'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
CfgType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr . |
SharedNetworkPtrType | One of the SharedNetwork4Ptr or SharedNetwork6Ptr . |
Definition at line 854 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), Element::integer, isc_throw, LOG_INFO, Element::map, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_SUBNET_DEL, and subnetToElement().
|
inline |
Provides a response to a 'network4-get' or 'network6-get' command.
cfg | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'network4-get' or 'network6-get'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
NetworkTypePtr | One of the following types: SharedNetwork4Ptr or SharedNetwork4Ptr . |
CfgType | One of the following types: CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr holding shared networks configuration. |
Definition at line 1040 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::createList(), Element::createMap(), isc_throw, LOG_INFO, Element::map, Element::string, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_NETWORK_GET, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_GET_EMPTY.
|
inline |
Returns a response to a 'network4-list' and 'network6-list' command.
Whether this function returns a list of IPv4 or IPv6 networks depends on the type of the cfg
object provided by the caller.
networks_cfg | Reference to the CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr object. |
protocol_type | 'IPv4' or 'IPv6', depending on the network types being retrieved. |
isc::data::Element
object holding the data structure reflecting a response to the command.CfgType | One of the following types: CfgSharedNetworks4Ptr or CfgSharedNetworks6Ptr holding shared networks configuration. |
Definition at line 985 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), LOG_INFO, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_NETWORK_LIST, and isc::subnet_cmds::SUBNET_CMDS_NETWORK_LIST_EMPTY.
|
inline |
Provides a response to a 'subnet4-get' or 'subnet6-get' command.
cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'subnet4-get' or 'subnet6-get'. |
subnet_parameter | One of the following: 'subnet4' or 'subnet6'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
SubnetTypePtr | One of the following types: ConstSubnet4Ptr or ConstSubnet6Ptr . |
CfgType | One of the following types: CfgSubnets4Ptr or CfgSubnets6Ptr holding subnets configuration. |
Definition at line 392 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::createList(), Element::createMap(), Element::integer, isc_throw, LOG_INFO, Element::map, Element::string, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_SUBNET_GET, and isc::subnet_cmds::SUBNET_CMDS_SUBNET_GET_EMPTY.
|
inline |
Returns a response to a 'subnet4-list' and 'subnet6-list' command.
Whether this function returns a list of IPv4 or IPv6 subnets depends on the type of the cfg
object provided by the caller.
cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
protocol_type | 'IPv4' or 'IPv6', depending on the subnet types being retrieved. |
isc::data::Element
object holding the data structure reflecting a response to the command.CfgType | One of the following types: CfgSubnets4Ptr or CfgSubnets6Ptr holding subnets configuration. |
Definition at line 337 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), Element::createList(), Element::createMap(), LOG_INFO, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_SUBNET_LIST, isc::subnet_cmds::SUBNET_CMDS_SUBNET_LIST_EMPTY, and subnetToElement().
|
inline |
Returns essential subnet parameters in Element format.
subnet details of that subnet will be returned
Definition at line 949 of file subnet_cmds.cc.
References Element::create(), isc::data::Element::create(), Element::createMap(), isc::dhcp::Subnet::getID(), isc::dhcp::Subnet::getSharedNetworkName(), and isc::dhcp::Subnet::toText().
Referenced by delSubnet(), and getSubnetList().
|
inline |
Provides a response to a 'subnet4-update' and 'subnet6-update' command.
This method is used for processing 'subnet4-update' and 'subnet6-update' commands. It parses received command, updates the subnet with the given ID in the current server configuration and provides a response to the controlling client.
cfg | Reference to the CfgSubnets4Ptr or CfgSubnets6Ptr object. |
arguments | Pointer to the arguments specified in the command. |
command_name | One of the following: 'subnet4-update' or 'subnet6-update'. |
subnet_parameter | One of the following: 'subnet4' or 'subnet6'. |
protocol_version | One of the following: 'IPv4' or 'IPv6'. |
type | The update type (replace, delta add, delta del). |
SimpleParserType | One of the SimpleParser4 or SimpleParser6 |
SubnetConfigParserType | One of the Subnet4ConfigParser or Subnet6ConfigParser . |
SharedNetworkPtrType | One of the SharedNetwork4 or SharedNetwork6 . |
SubnetTypePtr | One of the following types: Subnet4Ptr or Subnet6Ptr . |
CfgType | One of the CfgSubnets4Ptr or CfgSubnets6Ptr . |
Definition at line 654 of file subnet_cmds.cc.
References isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), DHCP4_OPTION_SPACE, DHCP6_OPTION_SPACE, isc::dhcp::CfgMgr::getCurrentCfg(), isc::data::SimpleParser::getInteger(), isc::dhcp::CfgMgr::instance(), isc_throw, Element::list, LOG_INFO, Element::map, isc::subnet_cmds::subnet_cmds_logger, isc::subnet_cmds::SUBNET_CMDS_SUBNET_UPDATE, and isc::subnet_cmds::UPDATE_REPLACE.