60template <
typename SubnetConfigParserType>
78 auto const& subnet_empty = [](
ElementPtr& element) {
79 for (
auto const& kv : element->mapValue()) {
80 auto const& key = kv.first;
81 if (key !=
"id" && key !=
"subnet") {
91 auto const& pool_empty = [](
ElementPtr& element) {
92 for (
auto const& kv : element->mapValue()) {
93 auto const& key = kv.first;
95 if (key ==
"option-data") {
96 if (kv.second->size()) {
110 auto const& pd_pool_empty = [](
ElementPtr& element) {
111 for (
auto const& kv : element->mapValue()) {
112 auto const& key = kv.first;
113 if (key !=
"prefix" && key !=
"prefix-len" && key !=
"delegated-len") {
114 if (key ==
"option-data") {
115 if (kv.second->size()) {
129 auto const& option_empty = [](
ElementPtr& element) {
130 for (
auto const& kv : element->mapValue()) {
131 auto const& key = kv.first;
132 if (key !=
"code" && key !=
"name" && key !=
"space") {
146 return (left->get(
"id")->intValue() == right->get(
"id")->intValue());
152 return (left->get(
"pool")->stringValue() == right->get(
"pool")->stringValue());
158 return (left->get(
"prefix")->stringValue() == right->get(
"prefix")->stringValue() &&
159 left->get(
"prefix-len")->intValue() == right->get(
"prefix-len")->intValue() &&
160 left->get(
"delegated-len")->intValue() == right->get(
"delegated-len")->intValue());
166 std::string left_space = space_;
167 std::string right_space = space_;
168 if (left->get(
"space")) {
169 left_space = left->get(
"space")->stringValue();
171 if (right->get(
"space")) {
172 right_space = right->get(
"space")->stringValue();
174 if (left_space == right_space) {
175 if (left->find(
"code") && right->find(
"code")) {
176 return (left->get(
"code")->intValue() == right->get(
"code")->intValue());
177 }
else if (left->find(
"name") && right->find(
"name")) {
178 return (left->get(
"name")->stringValue() == right->get(
"name")->stringValue());
186 auto const& subnet_is_key = [](
const std::string& key) ->
bool {
187 return (key ==
"id" || key ==
"subnet");
192 auto const& pool_is_key = [](
const std::string& key) ->
bool {
193 return (key ==
"pool");
198 auto const& pd_pool_is_key = [](
const std::string& key) ->
bool {
199 return (key ==
"prefix" || key ==
"prefix-len" || key ==
"delegated-len");
204 auto const& option_is_key = [](
const std::string& key) ->
bool {
205 return (key ==
"space" || key ==
"code" || key ==
"name");
208 subnet_hierarchy_any_match_ = {
209 { {
"subnet", { subnet_match, subnet_empty, subnet_is_key } } },
210 { {
"pools", { match_any, pool_empty, pool_is_key } },
211 {
"pd-pools", { match_any, pd_pool_empty, pd_pool_is_key } },
212 {
"option-data", { option_match, option_empty, option_is_key } } },
213 { {
"option-data", { option_match, option_empty, option_is_key } } }
216 subnet_hierarchy_ = {
217 { {
"subnet", { subnet_match, subnet_empty, subnet_is_key } } },
218 { {
"pools", { pool_match, pool_empty, pool_is_key } },
219 {
"pd-pools", { pd_pool_match, pd_pool_empty, pd_pool_is_key } },
220 {
"option-data", { option_match, option_empty, option_is_key } } },
221 { {
"option-data", { option_match, option_empty, option_is_key } } }
244 std::set<std::string> initial_keys;
245 for (
auto const& key : subnet_element->mapValue()) {
246 initial_keys.insert(key.first);
261 ElementPtr extended = boost::const_pointer_cast<Element>(subnet_element);
262 extend(
"option-data",
"data", extended, old_element, subnet_hierarchy_any_match_,
"subnet");
277 SubnetConfigParserType parser;
278 auto new_element = parser.parse(subnet_element)->toElement();
283 std::set<std::string> final_keys;
284 for (
auto const& key : new_element->mapValue()) {
285 if (initial_keys.find(key.first) == initial_keys.end()) {
286 final_keys.insert(key.first);
289 for (
auto const& value : final_keys) {
290 new_element->remove(value);
295 mergeDiffAdd(old_element, new_element, subnet_hierarchy_,
"subnet");
298 mergeDiffDel(old_element, new_element, subnet_hierarchy_,
"subnet");
337 template<
typename CfgType>
339 const std::string& protocol_type)
const {
344 args->set(
"subnets", subnet_list);
347 auto subnets = cfg->getAll();
350 for (
auto const& s : *subnets) {
356 std::ostringstream s;
357 s << subnets->size() <<
" " << protocol_type <<
" subnet";
360 if (subnets->size() != 1) {
366 if (subnets->size() > 0) {
368 .arg(subnets->size())
392 template<
typename SubnetTypePtr,
typename CfgType>
395 const std::string& command_name,
396 const std::string& subnet_parameter,
397 const std::string& protocol_version)
const {
401 << command_name <<
"' command");
406 << command_name <<
"' command are not a map");
410 }
else if (arguments->size() != 1) {
412 <<
" for the '" << command_name <<
"' command. Expecting"
413 " 'id' or 'subnet'");
416 SubnetTypePtr subnet;
428 subnet = cfg->getByPrefix(subnet_param->stringValue());
432 subnet_id_param = arguments->get(
"id");
433 if (subnet_id_param) {
439 subnet = cfg->getBySubnetId(
SubnetID(subnet_id_param->intValue()));
452 subnets_list->add(subnet->toElement());
454 response_arguments->set(subnet_parameter, subnets_list);
456 std::ostringstream s;
457 s <<
"Info about " << protocol_version <<
" subnet " << subnet->toText()
458 <<
" (id " << subnet->getID() <<
") returned";
463 .arg(subnet->toText())
464 .arg(subnet->getID());
470 s <<
"No " << subnet_param->stringValue() <<
" subnet found";
472 s <<
"No subnet with id " << subnet_id_param->intValue() <<
" found";
503 template<
typename SimpleParserType,
typename SubnetConfigParserType,
506 const std::string& command_name,
507 const std::string& subnet_parameter,
508 const std::string& protocol_version) {
513 << command_name <<
"' command");
518 << command_name <<
"' command are not a map");
520 }
else if (arguments->size() != 1) {
522 << arguments->size() <<
" for the '"
523 << command_name <<
"' command. Expecting "
524 "'" << subnet_parameter <<
"' list");
531 " argument for the '" << command_name <<
"' command");
536 " argument specified for the '"
537 << command_name <<
"' command is not a list");
540 }
else if (subnet_list->size() != 1) {
542 " '" << command_name <<
"' command. Expected one subnet");
549 "'" << command_name <<
"' command. Expected a map");
555 }
else if (subnet_element->get(
"reservations")) {
557 << command_name <<
"'. Use 'reservation-add' to add"
558 " a reservation to a subnet");
570 getConfiguredGlobals()->toElement();
572 global_scope->set(subnet_parameter, subnet_list);
576 SimpleParserType::setAllDefaults(global_scope);
577 SimpleParserType::deriveParameters(global_scope);
581 SubnetConfigParserType parser;
582 auto subnet = parser.parse(subnet_list->get(0));
589 cfg->updateStatistics();
593 subnet->initAllocatorsAfterConfigure();
597 subnet_info->set(
"id",
603 subnets_list->add(subnet_info);
608 response_arguments->set(
"subnets", subnets_list);
611 std::ostringstream response_text;
612 response_text << protocol_version <<
" subnet added";
620 .arg(subnet->toText())
621 .arg(subnet->getID());
652 template<
typename SimpleParserType,
typename SubnetConfigParserType,
653 typename SharedNetworkPtrType,
typename SubnetTypePtr,
657 const std::string& command_name,
658 const std::string& subnet_parameter,
659 const std::string& protocol_version,
665 << command_name <<
"' command");
670 << command_name <<
"' command are not a map");
672 }
else if (arguments->size() != 1) {
674 << arguments->size() <<
" for the '"
675 << command_name <<
"' command. Expecting "
676 "'" << subnet_parameter <<
"' list");
683 " argument for the '" << command_name <<
"' command");
688 " argument specified for the '"
689 << command_name <<
"' command is not a list");
692 }
else if (subnet_list->size() != 1) {
694 " '" << command_name <<
"' command. Expected one subnet");
701 "'" << command_name <<
"' command. Expected a map");
705 }
else if (subnet_element->get(
"reservations")) {
707 << command_name <<
"'.");
714 << command_name <<
"' command.");
720 auto old_subnet = cfg->getBySubnetId(subnet_id);
723 "Can't find subnet '" << subnet_id <<
"' to update");
727 auto old_element = old_subnet->toElement();
730 if (subnet_parameter ==
"subnet6") {
736 mgr.processDelta(type, old_element, subnet_element);
739 boost::const_pointer_cast<Element>(subnet_list)->set(0, old_element);
751 getConfiguredGlobals()->toElement();
753 global_scope->set(subnet_parameter, subnet_list);
757 SimpleParserType::setAllDefaults(global_scope);
758 SimpleParserType::deriveParameters(global_scope);
762 SubnetConfigParserType parser;
763 auto subnet = parser.parse(subnet_list->get(0));
767 cfg->removeStatistics();
771 auto old = cfg->replace(subnet);
774 <<
"' in the configuration");
778 SharedNetworkPtrType network;
779 old->getSharedNetwork(network);
781 if (!network->replace(subnet)) {
783 if (!cfg->replace(old)) {
785 << subnet_id <<
"' update. Configuration is "
786 "broken beyond repair.");
789 <<
"' update: update in shared network '"
790 << network->getName() <<
"' failed.");
796 cfg->updateStatistics();
802 cfg->updateStatistics();
806 subnet->initAllocatorsAfterConfigure();
810 subnet_info->set(
"id",
816 subnets_list->add(subnet_info);
821 response_arguments->set(
"subnets", subnets_list);
824 std::ostringstream response_text;
825 response_text << protocol_version <<
" subnet updated";
833 .arg(subnet->toText())
834 .arg(subnet->getID());
853 template<
typename CfgType,
854 typename SharedNetworkPtrType>
856 const std::string& command_name,
857 const std::string& protocol_version) {
861 << command_name <<
"' command");
866 << command_name <<
"' command are not a map");
869 }
else if (arguments->size() != 1) {
871 << command_name <<
" command. Expected subnet identifier");
875 if (!subnet_id_element) {
877 << command_name <<
"' command");
882 << command_name <<
"' is not a number");
885 uint32_t subnet_id =
static_cast<uint32_t
>(subnet_id_element->intValue());
886 auto subnet = cfg->getBySubnetId(
SubnetID(subnet_id));
891 std::stringstream tmp;
892 tmp <<
"no subnet with id " << subnet_id <<
" found";
897 cfg->removeStatistics();
903 SharedNetworkPtrType network;
904 subnet->getSharedNetwork(network);
906 network->del(subnet->getID());
911 if (command_name ==
"subnet4-del") {
912 cfg_hosts->delAll4(subnet_id);
914 cfg_hosts->delAll6(subnet_id);
919 cfg->updateStatistics();
924 cfg->updateStatistics();
926 std::ostringstream response_text;
927 response_text << protocol_version <<
" subnet " << subnet->toText()
928 <<
" (id " << subnet->getID() <<
") deleted";
933 details->set(
"subnets", lst);
937 response_text.str(), details);
940 .arg(subnet->toText())
941 .arg(subnet->getID());
952 subnet_element->set(
"id",
956 if (include_shared_network) {
958 if (!sn_name.empty()) {
966 return (subnet_element);
985 template<
typename CfgType>
987 const std::string& protocol_type)
const {
992 args->set(
"shared-networks", network_list);
995 auto networks = networks_cfg->getAll();
998 for (
auto const& n : *networks) {
1002 network_list->add(json);
1006 std::ostringstream s;
1007 s << networks->size() <<
" " << protocol_type <<
" network";
1009 if (networks->size() != 1) {
1015 if (networks->size() > 0) {
1017 .arg(networks->size())
1018 .arg(protocol_type);
1024 .arg(protocol_type);
1040 template<
typename NetworkTypePtr,
typename CfgType>
1043 const std::string& command_name,
1044 const std::string& protocol_version)
const {
1048 << command_name <<
"' command");
1053 << command_name <<
"' command are not a map");
1060 <<
"': missing mandatory 'name' parameter");
1067 NetworkTypePtr network = cfg->getByName(name->stringValue());
1074 networks_list->add(network->toElement());
1076 response_arguments->set(
"shared-networks", networks_list);
1078 std::ostringstream s;
1079 s <<
"Info about " << protocol_version <<
" shared network '" << network->getName()
1084 .arg(network->getName());
1088 std::stringstream s;
1089 s <<
"No '" << name->stringValue() <<
"' shared network found";
1122 template<
typename SimpleParserType,
typename SharedNetworkParserType,
1123 typename CfgNetworksType,
typename CfgSubnetsType>
1126 const std::string& command_name,
1127 const std::string& protocol_version) {
1132 << command_name <<
"' command");
1137 << command_name <<
"' command are not a map");
1143 if (!network_list) {
1145 " argument for the '" << command_name <<
"' command");
1150 << command_name <<
"' command is not a list");
1153 }
else if (network_list->size() != 1) {
1155 " '" << command_name <<
"' command. Expected one network");
1162 "'" << command_name <<
"' command. Expected a map");
1174 getConfiguredGlobals()->toElement();
1176 global_scope->set(
"shared-networks", network_list);
1180 SimpleParserType::setAllDefaults(global_scope);
1181 SimpleParserType::deriveParameters(global_scope);
1185 SharedNetworkParserType parser;
1186 auto network = parser.parse(network_list->get(0));
1189 networks_cfg->add(network);
1192 auto subnets_list = network->getAllSubnets();
1195 for (
auto const& subnet : *subnets_list) {
1196 subnets_cfg->add(subnet);
1202 subnets_cfg->updateStatistics();
1206 for (
auto const& subnet : *subnets_list) {
1207 subnet->initAllocatorsAfterConfigure();
1216 response_list->add(network_info);
1219 response_arguments->set(
"shared-networks", response_list);
1222 std::ostringstream response_text;
1223 response_text <<
"A new " << protocol_version <<
" shared network '" << network->getName()
1228 response_text.str(),
1229 response_arguments);
1232 .arg(network->getName());
1253 template<
typename CfgNetworksType,
typename CfgSubnetsType>
1256 const std::string& command_name,
1257 const std::string& protocol_version) {
1261 << command_name <<
"' command");
1266 << command_name <<
"' command are not a map");
1273 if (!name_element) {
1275 << command_name <<
"' command");
1278 << command_name <<
"' is not a string");
1283 if (subnet_action) {
1286 <<
" command must be a string. Supported values are: "
1287 <<
"'keep' and 'delete'.");
1289 string tmp = subnet_action->stringValue();
1290 if ( (tmp !=
"keep") && (tmp !=
"delete") ) {
1292 << tmp <<
", Supported values: 'keep' and 'delete'.");
1294 if (tmp ==
"delete") {
1299 std::string name = name_element->stringValue();
1301 auto network = networks_cfg->getByName(name);
1303 std::stringstream tmp;
1304 tmp <<
"no shared network with name '" << name <<
"' found";
1310 subnets_cfg->removeStatistics();
1317 auto network_subs = network->getAllSubnets();
1320 for (
auto const& sub : *network_subs) {
1321 subnets_cfg->del(sub);
1325 if (command_name ==
"network4-del") {
1326 cfg_hosts->delAll4(sub->getID());
1328 }
else if (command_name ==
"network6-del") {
1329 cfg_hosts->delAll6(sub->getID());
1333 networks_cfg->del(name);
1338 subnets_cfg->updateStatistics();
1342 subnets_cfg->updateStatistics();
1344 std::ostringstream response_text;
1345 response_text << protocol_version <<
" shared network '"
1346 << name <<
"' deleted";
1353 details->set(
"shared-networks", lst);
1357 response_text.str(), details);
1384 template<
typename CfgNetworksType,
typename CfgSubnetsType>
1387 const std::string& command_name,
1388 const std::string& protocol_version) {
1393 << command_name <<
"' command");
1398 << command_name <<
"' command are not a map");
1407 " argument for the '" << command_name <<
"' command");
1412 << command_name <<
"' command is not a string");
1414 string name = name_elem->stringValue();
1419 " argument for the '" << command_name <<
"' command");
1424 << command_name <<
"' command is not an integer");
1429 auto network = networks->getByName(name);
1432 std::stringstream tmp;
1433 tmp <<
"no " << protocol_version <<
" shared network with name '" << name <<
"' found";
1437 auto subnet = subnets->getSubnet(
id);
1439 std::stringstream tmp;
1440 tmp <<
"no " << protocol_version <<
" subnet with id '" <<
id <<
"' found";
1446 network->add(subnet);
1449 std::ostringstream response_text;
1450 response_text << protocol_version <<
" subnet " << subnet->toText() <<
" (id " <<
1451 id <<
") is now part of shared network '" << network->getName()
1455 .arg(protocol_version).arg(subnet->toText()).arg(
id).arg(network->getName());
1459 response_text.str());
1480 template<
typename CfgNetworksType>
1483 const std::string& command_name,
1484 const std::string& protocol_version) {
1489 << command_name <<
"' command");
1494 << command_name <<
"' command are not a map");
1503 " argument for the '" << command_name <<
"' command");
1508 << command_name <<
"' command is not a string");
1510 string name = name_elem->stringValue();
1515 " argument for the '" << command_name <<
"' command");
1520 << command_name <<
"' command is not an integer");
1525 auto network = networks->getByName(name);
1528 std::stringstream tmp;
1529 tmp <<
"no " << protocol_version <<
" shared network with name '" << name <<
"' found";
1534 auto subnet = network->getSubnet(
id);
1536 std::stringstream tmp;
1537 tmp <<
"The " << protocol_version <<
" subnet with id " <<
id
1538 <<
" is not part of the shared network with name '" << name <<
"' found";
1546 std::ostringstream response_text;
1547 response_text << protocol_version <<
" subnet " << subnet->toText() <<
" (id " <<
1548 id <<
") is now removed from shared network '" << network->getName()
1552 .arg(protocol_version).arg(subnet->toText()).arg(
id).arg(network->getName());
1556 response_text.str());
1569 return (impl_->getSubnetList(cfg,
"IPv4"));
1575 return (impl_->getSubnetList(cfg,
"IPv6"));
1581 return (impl_->getSubnet<
ConstSubnet4Ptr>(cfg, arguments,
"subnet4-get",
1582 "subnet4",
"IPv4"));
1588 return (impl_->getSubnet<
ConstSubnet6Ptr>(cfg, arguments,
"subnet6-get",
1589 "subnet6",
"IPv6"));
1600 "subnet4",
"IPv4"));
1609 "subnet6",
"IPv6"));
1619 "subnet4",
"IPv4"));
1629 "subnet6",
"IPv6"));
1652 "subnet4-delta-add",
1663 "subnet6-delta-add",
1674 "subnet4-delta-del",
1685 "subnet6-delta-del",
1697 return (impl_->getNetworkList(cfg,
"IPv4"));
1703 return (impl_->getNetworkList(cfg,
"IPv6"));
1709 return (impl_->getNetwork<
SharedNetwork4Ptr>(cfg, arguments,
"network4-get",
"IPv4"));
1715 return (impl_->getNetwork<
SharedNetwork6Ptr>(cfg, arguments,
"network6-get",
"IPv6"));
1726 "network4-add",
"IPv4"));
1735 "network6-add",
"IPv6"));
1743 return (impl_->delNetwork(cfg, subnets, arguments,
"network4-del",
"IPv4"));
1751 return (impl_->delNetwork(cfg, subnets, arguments,
"network6-del",
"IPv6"));
1759 return (impl_->addNetworkSubnet(networks, subnets, arguments,
"network4-subnet-add",
1768 return (impl_->addNetworkSubnet(networks, subnets, arguments,
"network6-subnet-add",
1776 return (impl_->delNetworkSubnet(networks, arguments,
"network4-subnet-del",
"IPv4"));
1783 return (impl_->delNetworkSubnet(networks, arguments,
"network6-subnet-del",
"IPv6"));
static ElementPtr create(const Position &pos=ZERO_POSITION())
Create a NullElement.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown when an object can not be found.
A generic exception that is thrown when an unexpected error condition occurs.
static ElementPtr create(const Position &pos=ZERO_POSITION())
Create a NullElement.
static int64_t getInteger(isc::data::ConstElementPtr scope, const std::string &name)
Returns an integer parameter from a scope.
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
Implements parser for IPv4 shared networks.
Implements parser for IPv6 shared networks.
A configuration holder for IPv4 subnet.
A configuration holder for IPv6 subnet.
SubnetID getID() const
Returns unique ID for that subnet.
virtual std::string toText() const
Returns textual representation of the subnet (e.g.
std::string getSharedNetworkName() const
Returns shared network name.
Manager which handles the delta (differences) between two subnets serialized as a JSON tree (usually ...
void processDelta(UpdateType type, ElementPtr &old_element, ConstElementPtr &subnet_element)
Process the delta between existing configuration and user provided data.
~ConfigDiffManager()=default
Destructor.
ConfigDiffManager(std::string space)
Constructor.
Implementation of the SubnetCmds class.
ConstElementPtr getNetworkList(const CfgType &networks_cfg, const std::string &protocol_type) const
Returns a response to a 'network4-list' and 'network6-list' command.
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.
ElementPtr subnetToElement(const Subnet &subnet, bool include_shared_network) const
Returns essential subnet parameters in Element format.
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.
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.
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.
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.
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.
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.
ConstElementPtr getSubnetList(const CfgType &cfg, const std::string &protocol_type) const
Returns a response to a 'subnet4-list' and 'subnet6-list' command.
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.
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.
data::ConstElementPtr addNetwork4Subnet(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network4-subnet-add' command.
data::ConstElementPtr addSubnet6Delta(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet6-delta-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 delNetwork6Subnet(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network6-subnet-del' command.
data::ConstElementPtr getSubnet6(const data::ConstElementPtr &arguments) const
Returns a response to 'subnet6-get' command.
data::ConstElementPtr getNetwork6(const data::ConstElementPtr &arguments) const
Returns a response to 'network6-get' command.
data::ConstElementPtr updateSubnet6(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet6-update' command.
data::ConstElementPtr getSubnet4(const data::ConstElementPtr &arguments) const
Returns a response to 'subnet4-get' command.
data::ConstElementPtr getNetwork4List() const
Returns a response to a 'network4-list' command.
data::ConstElementPtr delNetwork4Subnet(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network4-subnet-del' command.
data::ConstElementPtr getNetwork4(const data::ConstElementPtr &arguments) const
Returns a response to 'network4-get' command.
data::ConstElementPtr getNetwork6List() const
Returns a response to a 'network6-list' command.
data::ConstElementPtr delSubnet6(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet6-del' command.
data::ConstElementPtr delNetwork4(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network4-del' command.
data::ConstElementPtr updateSubnet4(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet4-update' command.
data::ConstElementPtr getSubnet6List() const
Returns a response to a 'subnet6-list' command.
data::ConstElementPtr addNetwork6(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network6-add' command.
data::ConstElementPtr addNetwork4(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network4-add' command.
data::ConstElementPtr delNetwork6(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network6-del' command.
data::ConstElementPtr addSubnet4(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet4-add' command.
data::ConstElementPtr delSubnet4Delta(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet4-delta-del' command.
data::ConstElementPtr addNetwork6Subnet(const data::ConstElementPtr &arguments)
Processes and returns a response to 'network6-subnet-add' command.
data::ConstElementPtr delSubnet6Delta(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet6-delta-del' command.
data::ConstElementPtr getSubnet4List() const
Returns a response to a 'subnet4-list' command.
data::ConstElementPtr delSubnet4(const data::ConstElementPtr &arguments)
Processes and returns a response to 'subnet4-del' command.
RAII class creating a critical section.
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
const int CONTROL_RESULT_EMPTY
Status code indicating that the specified command was completed correctly, but failed to produce any ...
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
void extend(const std::string &container, const std::string &extension, ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx, bool alter, unsigned level)
Extends data by adding the specified 'extension' elements from 'other' inside the 'container' element...
boost::shared_ptr< const Element > ConstElementPtr
void mergeDiffAdd(ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx, unsigned level)
Merges the diff data by adding the missing elements from 'other' to 'element' (recursively).
void mergeDiffDel(ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx, unsigned level)
Merges the diff data by removing the data present in 'other' from 'element' (recursively).
boost::shared_ptr< Element > ElementPtr
std::vector< FunctionMap > HierarchyDescriptor
Hierarchy descriptor of the containers in a specific Element hierarchy tree.
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
boost::shared_ptr< CfgSubnets6 > CfgSubnets6Ptr
Non-const pointer.
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
boost::shared_ptr< CfgSharedNetworks6 > CfgSharedNetworks6Ptr
Pointer to the configuration of IPv6 shared networks.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::shared_ptr< CfgHosts > CfgHostsPtr
Non-const pointer.
boost::shared_ptr< CfgSubnets4 > CfgSubnets4Ptr
Non-const pointer.
boost::shared_ptr< const CfgSubnets4 > ConstCfgSubnets4Ptr
Const pointer.
boost::shared_ptr< const CfgSubnets6 > ConstCfgSubnets6Ptr
Const pointer.
boost::shared_ptr< CfgSharedNetworks4 > CfgSharedNetworks4Ptr
Pointer to the configuration of IPv4 shared networks.
boost::shared_ptr< SharedNetwork4 > SharedNetwork4Ptr
Pointer to SharedNetwork4 object.
const isc::log::MessageID SUBNET_CMDS_NETWORK_LIST
const isc::log::MessageID SUBNET_CMDS_NETWORK_ADD
const isc::log::MessageID SUBNET_CMDS_SUBNET_DEL
const isc::log::MessageID SUBNET_CMDS_SUBNET_ADD
const isc::log::MessageID SUBNET_CMDS_NETWORK_SUBNET_ADD
const isc::log::MessageID SUBNET_CMDS_SUBNET_UPDATE
const isc::log::MessageID SUBNET_CMDS_NETWORK_SUBNET_DEL
const isc::log::MessageID SUBNET_CMDS_SUBNET_LIST_EMPTY
const isc::log::MessageID SUBNET_CMDS_NETWORK_LIST_EMPTY
const isc::log::MessageID SUBNET_CMDS_SUBNET_GET_EMPTY
const isc::log::MessageID SUBNET_CMDS_NETWORK_GET_EMPTY
const isc::log::MessageID SUBNET_CMDS_SUBNET_GET
const isc::log::MessageID SUBNET_CMDS_NETWORK_DEL
isc::log::Logger subnet_cmds_logger("subnet-cmds-hooks")
const isc::log::MessageID SUBNET_CMDS_NETWORK_GET
const isc::log::MessageID SUBNET_CMDS_SUBNET_LIST
UpdateType
Type of subnet update.
@ UPDATE_DELTA_DEL
update the old subnet by removing the parameters from the new entry.
@ UPDATE_REPLACE
completely replace old subnet with the new entry.
@ UPDATE_DELTA_ADD
update the old subnet by adding the parameters form the new entry.
Defines the logger used by the top-level component of kea-lfc.
#define DHCP4_OPTION_SPACE
global std option spaces
#define DHCP6_OPTION_SPACE