30#include <boost/algorithm/string.hpp>
31#include <boost/foreach.hpp>
295 void validateHostForSubnet6(
SubnetID subnet_id,
296 const std::vector<IOAddress>& addresses);
350 string txt =
"(missing parameters)";
351 bool force_global(
false);
376 if (family_ == AF_INET) {
379 force_global = checkHost4(host);
381 host->setIPv4SubnetID(SUBNET_ID_GLOBAL);
386 force_global = checkHost6(host);
388 host->setIPv6SubnetID(SUBNET_ID_GLOBAL);
402 if (family_ == AF_INET) {
405 validateHostForSubnet4(host->getIPv4SubnetID(),
406 host->getIPv4Reservation());
415 std::vector<IOAddress> addresses;
416 BOOST_FOREACH(
auto const& address, range) {
417 addresses.push_back(address.second.getPrefix());
422 validateHostForSubnet6(host->getIPv6SubnetID(), addresses);
426 }
catch (
const std::exception& ex) {
436 string msg(
"Host added.");
438 msg +=
" subnet-id not specified, assumed global (subnet-id 0).";
458 if (params->contains(
"subnet-id") || (!addr && !type && !ident)) {
460 0, dhcp::SUBNET_ID_MAX);
461 x.subnet_id =
static_cast<SubnetID>(value);
462 x.has_subnet_id =
true;
464 x.has_subnet_id =
false;
467 x.operation_target = getOperationTarget(params);
471 isc_throw(BadValue,
"'ip-address' is not a string.");
474 x.addr = IOAddress(addr->stringValue());
475 x.query_by_addr =
true;
476 if (!x.has_subnet_id) {
477 isc_throw(BadValue,
"missing parameter 'subnet-id', use "
478 "'reservation-get-by-address' with 'ip-address' set to \""
479 << addr->stringValue() <<
"\" to get the list of "
480 <<
"reservations with this address");
490 isc_throw(BadValue,
"No 'ip-address' provided"
491 " and 'identifier-type' is either missing or not a string.");
494 isc_throw(BadValue,
"No 'ip-address' provided"
495 " and 'identifier' is either missing or not a string.");
503 if (x.ident.empty()) {
510 isc_throw(BadValue,
"Unable to parse 'identifier' value.");
513 if (x.ident.empty()) {
514 isc_throw(BadValue,
"Unable to query for empty 'identifier'.");
520 }
catch (
const std::exception& ex) {
521 isc_throw(BadValue,
"Value of 'identifier-type' was not recognized.");
524 x.query_by_addr =
false;
525 if (!x.has_subnet_id) {
526 isc_throw(BadValue,
"missing parameter 'subnet-id', use "
527 "'reservation-get-by-id' with 'identifier-type' set to \""
528 << type->stringValue() <<
"\" and 'identifier' to \""
529 << ident->stringValue() <<
"\" to get the list of "
530 <<
"reservations with this identifier");
536HostCmdsImpl::validateHostForSubnet4(
SubnetID subnet_id,
const IOAddress& address) {
537 if (subnet_id != 0) {
539 auto subnet = cfg->getBySubnetId(subnet_id);
542 "IPv4 subnet with ID of '" << subnet_id
543 <<
"' is not configured");
547 && !subnet->inRange(address)) {
549 "specified reservation '" << address
550 <<
"' is not matching the IPv4 subnet prefix '"
551 << subnet->toText() <<
"'");
557HostCmdsImpl::validateHostForSubnet6(
SubnetID subnet_id,
558 const std::vector<IOAddress>& addresses) {
559 if (subnet_id != 0) {
561 auto subnet = cfg->getBySubnetId(subnet_id);
564 "IPv6 subnet with ID of '" << subnet_id
565 <<
"' is not configured");
568 for (
auto const& address : addresses) {
569 if (!subnet->inRange(address)) {
571 "specified reservation '" << address
572 <<
"' is not matching the IPv6 subnet prefix '"
573 << subnet->toText() <<
"'");
581 if (host->getIPv4SubnetID() != SUBNET_ID_UNUSED) {
584 const IOAddress& addr = host->getIPv4Reservation();
591 for (
auto const& subnet : *subnets->getAll()) {
592 if (!subnet->inRange(addr)) {
595 if (subnet->clientSupported(ClientClasses())) {
601 }
else if (!guarded) {
607 if (guarded && candidate) {
610 if (!guarded && !candidate) {
611 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
612 <<
" The address '" << addr.
toText()
613 <<
"' belongs to no configured subnet.");
616 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
617 <<
" The address '" << addr.
toText()
618 <<
"' belongs to subnet '" << candidate->toText()
619 <<
"' id " << candidate->getID()
620 << (others ?
" and others." :
"."));
622 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
623 <<
" The address '" << addr.
toText()
624 <<
"' belongs to guarded subnet '" << guarded->toText()
625 <<
"' id " << guarded->getID()
626 << (others ?
" and others." :
"."));
635 if (host->getIPv6SubnetID() != SUBNET_ID_UNUSED) {
638 auto const& range = host->getIPv6Reservations();
639 std::vector<IOAddress> addresses;
640 bool has_prefixes =
false;
641 BOOST_FOREACH(
auto const& address, range) {
643 addresses.push_back(address.second.getPrefix());
648 if (!addresses.empty()) {
654 for (
auto const& subnet : *subnets->getAll()) {
655 bool in_range =
true;
656 for (
auto const& address : addresses) {
657 if (!subnet->inRange(address)) {
665 if (subnet->clientSupported(ClientClasses())) {
671 }
else if (!guarded) {
677 if (guarded && candidate) {
680 if (!guarded && !candidate) {
681 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
682 <<
" Reserved IPv6 addresses do not belong to a"
683 <<
" common configured subnet.");
686 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
687 <<
" Reserved IPv6 addresses belong to subnet '"
688 << candidate->toText() <<
"' id " << candidate->getID()
689 << (others ?
" and others." :
"."));
691 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
692 <<
" Reserved IPv6 addresses belong to guarded subnet '"
693 << guarded->toText() <<
"' id " << guarded->getID()
694 << (others ?
" and others." :
"."));
696 }
else if (has_prefixes) {
697 isc_throw(isc::BadValue,
"Mandatory 'subnet-id' parameter missing."
698 <<
" Prefixes are not attached to subnets so no hint is"
707 string txt =
"(missing parameters)";
735 if (family_ == AF_INET) {
745 if (family_ == AF_INET) {
746 host_json = host->toElement4();
747 subnet_id = host->getIPv4SubnetID();
749 host_json = host->toElement6();
750 subnet_id = host->getIPv6SubnetID();
754 }
catch (
const std::exception& ex) {
767 "Host found.", host_json);
778 string txt =
"(missing parameters)";
798 if (family_ == AF_INET) {
803 validateHostForSubnet6(p.
subnet_id, std::vector<IOAddress>());
807 if (family_ == AF_INET) {
818 for (
auto const& host : hosts) {
820 if (family_ == AF_INET) {
821 subnet_id = host->getIPv4SubnetID();
823 subnet_id = host->getIPv6SubnetID();
826 if (subnet_id == SUBNET_ID_UNUSED) {
831 if (family_ == AF_INET) {
832 host_json = host->toElement4();
834 host_json = host->toElement6();
838 hosts_json->add(host_json);
840 }
catch (
const std::exception& ex) {
852 msg << hosts_json->size()
853 <<
" IPv" << (family_ == AF_INET ?
"4" :
"6")
854 <<
" host(s) found.";
856 result->set(
"hosts", hosts_json);
869 string txt =
"(missing parameters)";
891 if (family_ == AF_INET) {
901 }
catch (
const std::exception& ex) {
932 0, dhcp::SUBNET_ID_MAX);
933 x.subnet_id =
static_cast<SubnetID>(tmp);
934 x.has_subnet_id =
true;
936 x.operation_target = getOperationTarget(params);
941HostCmdsImpl::Parameters
950 numeric_limits<uint32_t>::max());
951 x.page_limit =
static_cast<size_t>(tmp);
954 if (params->contains(
"subnet-id")) {
956 0, dhcp::SUBNET_ID_MAX);
957 x.subnet_id =
static_cast<SubnetID>(tmp);
958 x.has_subnet_id =
true;
962 if (params->get(
"source-index")) {
964 x.source_index =
static_cast<size_t>(tmp);
968 if (params->get(
"from")) {
970 x.host_id =
static_cast<uint64_t
>(tmp);
981 isc_throw(BadValue,
"Parameters missing or are not a map.");
985 x.hostname = hostname;
988 if (params->contains(
"subnet-id")) {
990 0, dhcp::SUBNET_ID_MAX);
991 x.subnet_id =
static_cast<SubnetID>(tmp);
992 x.has_subnet_id =
true;
995 x.operation_target = getOperationTarget(params);
1005 isc_throw(BadValue,
"Parameters missing or are not a map.");
1011 isc_throw(BadValue,
"'identifier-type' is either missing"
1012 " or not a string.");
1015 isc_throw(BadValue,
"'identifier' is either missing or not a string.");
1019 if (params->contains(
"subnet-id")) {
1020 isc_throw(BadValue,
"'subnet-id' is forbidden in reservation-get-by-id");
1028 if (x.ident.empty()) {
1035 isc_throw(BadValue,
"Unable to parse 'identifier' value.");
1038 if (x.ident.empty()) {
1039 isc_throw(BadValue,
"Unable to query for empty 'identifier'.");
1045 }
catch (
const std::exception& ex) {
1046 isc_throw(BadValue,
"Value of 'identifier-type' was not recognized.");
1059 isc_throw(BadValue,
"Parameters missing or are not a map.");
1066 if (!addr.
isV4() && !addr.
isV6()) {
1067 isc_throw(BadValue,
"Failed to parse IP address " << addr);
1071 x.query_by_addr =
true;
1073 if (params->contains(
"subnet-id")) {
1075 0, dhcp::SUBNET_ID_MAX);
1076 x.subnet_id =
static_cast<SubnetID>(tmp);
1077 x.has_subnet_id =
true;
1080 x.operation_target = getOperationTarget(params);
1088 if (!args->get(
"operation-target")) {
1089 return HostMgrOperationTarget::UNSPECIFIED_SOURCE;
1094 if (raw ==
"memory") {
1095 return HostMgrOperationTarget::PRIMARY_SOURCE;
1096 }
else if (raw ==
"database") {
1097 return HostMgrOperationTarget::ALTERNATE_SOURCES;
1098 }
else if (raw ==
"all") {
1099 return HostMgrOperationTarget::ALL_SOURCES;
1100 }
else if (raw ==
"default") {
1101 return HostMgrOperationTarget::UNSPECIFIED_SOURCE;
1104 "The 'operation-target' value (" << raw
1105 <<
") is not within expected set: (memory, database, all, "
1112 string txt =
"(missing parameters)";
1130 if (family_ == AF_INET) {
1135 validateHostForSubnet6(p.
subnet_id, std::vector<IOAddress>());
1138 for (
auto const& host : hosts) {
1140 if (family_ == AF_INET) {
1141 host_json = host->toElement4();
1142 SubnetID subnet_id = host->getIPv4SubnetID();
1145 host_json = host->toElement6();
1146 SubnetID subnet_id = host->getIPv6SubnetID();
1149 hosts_json->add(host_json);
1151 }
catch (
const std::exception& ex) {
1163 msg << hosts_json->size()
1164 <<
" IPv" << (family_ == AF_INET ?
"4" :
"6")
1165 <<
" host(s) found.";
1167 result->set(
"hosts", hosts_json);
1180 string txt =
"(missing parameters)";
1184 uint64_t last_id(0);
1199 if (family_ == AF_INET) {
1205 validateHostForSubnet6(p.
subnet_id, std::vector<IOAddress>());
1210 if (family_ == AF_INET) {
1218 for (
auto const& host : hosts) {
1220 if (family_ == AF_INET) {
1221 subnet_id = host->getIPv4SubnetID();
1223 subnet_id = host->getIPv6SubnetID();
1225 if (subnet_id == SUBNET_ID_UNUSED) {
1229 if (family_ == AF_INET) {
1230 host_json = host->toElement4();
1232 host_json = host->toElement6();
1235 hosts_json->add(host_json);
1236 last_id = host->getHostId();
1238 }
catch (
const std::exception& ex) {
1250 msg << hosts_json->size()
1251 <<
" IPv" << (family_ == AF_INET ?
"4" :
"6")
1252 <<
" host(s) found.";
1254 result->set(
"hosts", hosts_json);
1255 result->set(
"count",
1257 if (hosts_json->size() > 0) {
1259 next->set(
"source-index",
1262 result->set(
"next", next);
1276 string txt =
"(missing parameters)";
1294 if (hostname.empty()) {
1297 boost::algorithm::to_lower(hostname);
1300 if (family_ == AF_INET) {
1307 validateHostForSubnet6(p.
subnet_id, std::vector<IOAddress>());
1320 for (
auto const& host : hosts) {
1322 if (family_ == AF_INET) {
1323 subnet_id = host->getIPv4SubnetID();
1325 subnet_id = host->getIPv6SubnetID();
1327 if (subnet_id == SUBNET_ID_UNUSED) {
1331 if (family_ == AF_INET) {
1332 host_json = host->toElement4();
1334 host_json = host->toElement6();
1337 hosts_json->add(host_json);
1339 }
catch (
const std::exception& ex) {
1351 msg << hosts_json->size()
1352 <<
" IPv" << (family_ == AF_INET ?
"4" :
"6")
1353 <<
" host(s) found.";
1355 result->set(
"hosts", hosts_json);
1368 string txt =
"(missing parameters)";
1390 for (
auto const& host : hosts) {
1391 if (family_ == AF_INET) {
1392 subnet_id = host->getIPv4SubnetID();
1394 subnet_id = host->getIPv6SubnetID();
1396 if (subnet_id == SUBNET_ID_UNUSED) {
1399 if (family_ == AF_INET) {
1400 host_json = host->toElement4();
1402 host_json = host->toElement6();
1405 hosts_json->add(host_json);
1407 }
catch (
const std::exception& ex) {
1419 msg << hosts_json->size()
1420 <<
" IPv" << (family_ == AF_INET ?
"4" :
"6")
1421 <<
" host(s) found.";
1423 result->set(
"hosts", hosts_json);
1436 string parameters(
"(missing parameters)");
1459 isc_throw(
BadValue,
"invalid command: expected 'reservation' as the sole parameter "
1460 "inside the 'arguments' map, didn't get it instead");
1474 if (family_ == AF_INET) {
1492 if (family_ == AF_INET) {
1495 validateHostForSubnet4(host->getIPv4SubnetID(),
1496 host->getIPv4Reservation());
1505 std::vector<IOAddress> addresses;
1506 BOOST_FOREACH(
auto const& address, range) {
1507 addresses.push_back(address.second.getPrefix());
1512 validateHostForSubnet6(host->getIPv6SubnetID(), addresses);
1517 }
catch (exception
const& exception) {
1520 .arg(exception.what());
1537 return (impl_->reservationAddHandler(handle));
1542 return (impl_->reservationGetHandler(handle));
1547 return (impl_->reservationDelHandler(handle));
1552 return (impl_->reservationGetAllHandler(handle));
1557 return (impl_->reservationGetPageHandler(handle));
1562 return (impl_->reservationGetByHostnameHandler(handle));
1567 return (impl_->reservationGetByIdHandler(handle));
1572 return (impl_->reservationUpdateHandler(handle));
1577 return (impl_->reservationGetByAddressHandler(handle));
static ElementPtr create(const Position &pos=ZERO_POSITION())
Create a NullElement.
static std::string typeToName(Element::types type)
Returns the name of the given type as a string.
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...
The IOAddress class represents an IP addresses (version agnostic).
static const IOAddress & IPV4_ZERO_ADDRESS()
Returns an address set to all zeros.
bool isV4Zero() const
Convenience function to check if it is an IPv4 zero address.
std::string toText() const
Convert the address to a string.
bool isV6() const
Convenience function to check for an IPv6 address.
bool isV4() const
Convenience function to check for an IPv4 address.
bool isV6Zero() const
Convenience function to check if it is an IPv4 zero address.
Base class that command handler implementers may use for common tasks.
void setErrorResponse(hooks::CalloutHandle &handle, const std::string &text, int status=CONTROL_RESULT_ERROR)
Set the callout argument "response" to indicate an error.
data::ConstElementPtr cmd_args_
Stores the command arguments extracted by a call to extractCommand.
void extractCommand(hooks::CalloutHandle &handle)
Extracts the command name and arguments from a Callout handle.
void setSuccessResponse(hooks::CalloutHandle &handle, const std::string &text)
Set the callout argument "response" to indicate success.
void setResponse(hooks::CalloutHandle &handle, data::ConstElementPtr &response)
Set the callout argument "response" to the given response.
static isc::asiolink::IOAddress getAddress(const ConstElementPtr &scope, const std::string &name)
Returns a IOAddress parameter from a scope.
static std::string getString(isc::data::ConstElementPtr scope, const std::string &name)
Returns a string parameter from a scope.
static int64_t getInteger(isc::data::ConstElementPtr scope, const std::string &name)
Returns an integer parameter from a scope.
uint16_t getFamily() const
Returns address family.
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
ConstHostCollection getAll6(const SubnetID &subnet_id, const HostMgrOperationTarget target) const
Return all hosts in a DHCPv6 subnet.
ConstHostCollection getAll4(const SubnetID &subnet_id, const HostMgrOperationTarget target) const
Return all hosts in a DHCPv4 subnet.
virtual ConstHostCollection getPage6(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv6 subnet.
ConstHostCollection getAllbyHostname4(const std::string &hostname, const SubnetID &subnet_id, const HostMgrOperationTarget target) const
Return all hosts with a hostname in a DHCPv4 subnet.
bool del4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target)
Attempts to delete a host by (subnet4-id, identifier, identifier-type, operation-target).
ConstHostCollection getAll(const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target) const
Return all hosts connected to any subnet for which reservations have been made using a specified iden...
bool del6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target)
Attempts to delete a host by (subnet6-id, identifier, identifier-type, operation-target).
void add(const HostPtr &host, const HostMgrOperationTarget target)
Adds a new host to the alternate data source.
bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr, const HostMgrOperationTarget target)
Attempts to delete hosts by address.
ConstHostCollection getAllbyHostname6(const std::string &hostname, const SubnetID &subnet_id, const HostMgrOperationTarget target) const
Return all hosts with a hostname in a DHCPv6 subnet.
virtual ConstHostCollection getPage4(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv4 subnet.
HostDataSourcePtr getHostDataSource() const
Returns the first host data source.
static HostMgr & instance()
Returns a sole instance of the HostMgr.
void update(HostPtr const &host, const HostMgrOperationTarget target)
Implements BaseHostDataSource::update() for alternate sources.
ConstHostCollection getAllbyHostname(const std::string &hostname, const HostMgrOperationTarget target) const
Return all hosts with a hostname.
ConstHostPtr get4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target) const
Returns a host connected to the IPv4 subnet.
ConstHostPtr get6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target) const
Returns a host connected to the IPv6 subnet.
Wraps value holding size of the page with host reservations.
Represents a device with IPv4 and/or IPv6 reservations.
IdentifierType getIdentifierType() const
Returns the identifier type.
IdentifierType
Type of the host identifier.
Per-packet callout handle.
Parameters specified for reservation-get and reservation-del.
HostMgrOperationTarget operation_target
Specifies the target host source (default UNSPECIFIED_SOURCE which means the default host source is c...
std::string hostname
Specifies host name (default "").
Parameters()
Default constructor.
uint64_t host_id
Specifies host identifier (default 0).
std::vector< uint8_t > ident
Specifies identifier value (used when query_by_addr is false).
SubnetID subnet_id
Specifies subnet-id.
bool query_by_addr
Specifies parameter types (true = query by address, false = query by identifier-type,...
size_t source_index
Specifies source index (default 0).
Host::IdentifierType type
Specifies identifier type (usually FLEX_ID, used when query_by_addr is false).
IOAddress addr
Specifies IPv4 or IPv6 address (used when query_by_addr is true).
bool has_subnet_id
Specifies if subnet-id is present.
size_t page_limit
Specifies page limit (no default).
Wrapper class around reservation command handlers.
HostCmdsImpl()
Constructor.
int reservationGetAllHandler(CalloutHandle &handle)
reservation-get-all command handler
int reservationAddHandler(CalloutHandle &handle)
reservation-add command handler
int reservationGetPageHandler(CalloutHandle &handle)
reservation-get-page command handler
int reservationGetHandler(CalloutHandle &handle)
reservation-get command handler
int reservationUpdateHandler(CalloutHandle &handle)
reservation-update command handler
~HostCmdsImpl()
Destructor.
int reservationGetByHostnameHandler(CalloutHandle &handle)
reservation-get-by-hostname command handler
int reservationDelHandler(CalloutHandle &handle)
reservation-del command handler
int reservationGetByAddressHandler(CalloutHandle &handle)
reservation-get-by-address command handler
int reservationGetByIdHandler(CalloutHandle &handle)
reservation-get-by-id command handler
int reservationGetPageHandler(hooks::CalloutHandle &handle)
reservation-get-page command handler
int reservationGetAllHandler(hooks::CalloutHandle &handle)
reservation-get-all command handler
int reservationGetByAddressHandler(hooks::CalloutHandle &handle)
reservation-get-by-address command handler
int reservationGetByHostnameHandler(hooks::CalloutHandle &handle)
reservation-get-by-hostname command handler
int reservationUpdateHandler(hooks::CalloutHandle &handle)
reservation-update command handler
int reservationGetHandler(hooks::CalloutHandle &handle)
reservation-get command handler
int reservationAddHandler(hooks::CalloutHandle &handle)
reservation-add command handler
int reservationDelHandler(hooks::CalloutHandle &handle)
reservation-del command handler
int reservationGetByIdHandler(hooks::CalloutHandle &handle)
reservation-get-by-id command handler
isc::dhcp::HostPtr parseWithSubnet(isc::data::ConstElementPtr host_data, bool required=true)
Parser specified parameter as host reservation data.
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.
const isc::log::MessageID HOST_CMDS_RESERV_UPDATE
const isc::log::MessageID HOST_CMDS_RESERV_GET_ALL_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_ADD
const isc::log::MessageID HOST_CMDS_RESERV_GET_PAGE
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_HOSTNAME_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_DEL_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_ADD_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ID
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ADDRESS_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_PAGE_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET
const isc::log::MessageID HOST_CMDS_RESERV_DEL
const isc::log::MessageID HOST_CMDS_RESERV_UPDATE_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_PAGE_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ID_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ADDRESS_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET_ALL_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_UPDATE_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET_ALL
const isc::log::MessageID HOST_CMDS_RESERV_DEL_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_HOSTNAME_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ID_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_ADD_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_SUCCESS
const isc::log::MessageID HOST_CMDS_RESERV_GET_FAILED
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_HOSTNAME
const isc::log::MessageID HOST_CMDS_RESERV_GET_BY_ADDRESS
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
const char * CONTROL_ARGUMENTS
String used for arguments map ("arguments").
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.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< BaseHostDataSource > HostDataSourcePtr
HostDataSource pointer.
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
isc::log::Logger host_cmds_logger("host-cmds-hooks")
HostDataParser< isc::dhcp::HostReservationParser6 > HostDataParser6
Parser for DHCPv4 host reservation.
HostDataParser< isc::dhcp::HostReservationParser4 > HostDataParser4
Parser for DHCPv4 host reservation.
void decodeFormattedHexString(const string &hex_string, vector< uint8_t > &binary)
Converts a formatted string of hexadecimal digits into a vector.
vector< uint8_t > quotedStringToBinary(const string "ed_string)
Converts a string in quotes into vector.
Defines the logger used by the top-level component of kea-lfc.