2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[master] Merge branch 'trac3941'

This commit is contained in:
Marcin Siodelski
2015-07-13 17:45:33 +02:00
6 changed files with 132 additions and 133 deletions

View File

@@ -29,11 +29,11 @@ const char* DHCP4_DDNS_LOGGER_NAME = "ddns";
const char* DHCP4_LEASE_LOGGER_NAME = "leases";
isc::log::Logger dhcp4_logger(DHCP4_APP_LOGGER_NAME);
isc::log::Logger bad_packet_logger(DHCP4_BAD_PACKET_LOGGER_NAME);
isc::log::Logger packet_logger(DHCP4_PACKET_LOGGER_NAME);
isc::log::Logger options_logger(DHCP4_OPTIONS_LOGGER_NAME);
isc::log::Logger ddns_logger(DHCP4_DDNS_LOGGER_NAME);
isc::log::Logger lease_logger(DHCP4_LEASE_LOGGER_NAME);
isc::log::Logger bad_packet4_logger(DHCP4_BAD_PACKET_LOGGER_NAME);
isc::log::Logger packet4_logger(DHCP4_PACKET_LOGGER_NAME);
isc::log::Logger options4_logger(DHCP4_OPTIONS_LOGGER_NAME);
isc::log::Logger ddns4_logger(DHCP4_DDNS_LOGGER_NAME);
isc::log::Logger lease4_logger(DHCP4_LEASE_LOGGER_NAME);
} // namespace dhcp
} // namespace isc

View File

@@ -102,30 +102,30 @@ extern isc::log::Logger dhcp4_logger;
/// Here "bad packets" are packets that are either dropped (i.e malformed,
/// unsupported types) or packets that are rejected and NAKed for logical
/// reasons.
extern isc::log::Logger bad_packet_logger;
extern isc::log::Logger bad_packet4_logger;
/// @brief Logger for processed packets.
///
/// This logger is used to issue log messages related to the reception and
/// sending DHCP packets.
extern isc::log::Logger packet_logger;
extern isc::log::Logger packet4_logger;
/// @brief Logger for options parser.
///
/// This logger is used to issue log messages related to processing of the
/// DHCP options
extern isc::log::Logger options_logger;
extern isc::log::Logger options4_logger;
/// @brief Logger for Hostname or FQDN processing.
///
/// This logger is used to issue log messages related to processing the
/// hostnames, FQDNs and sending name change requests to D2.
extern isc::log::Logger ddns_logger;
extern isc::log::Logger ddns4_logger;
/// @brief Logger for lease allocation logic.
///
/// This logger is used to issue log messages related to lease allocation.
extern isc::log::Logger lease_logger;
extern isc::log::Logger lease4_logger;
//@}

View File

@@ -320,17 +320,17 @@ Dhcpv4Srv::selectSubnet(const Pkt4Ptr& query) const {
if (subnet) {
// Log at higher debug level that subnet has been found.
LOG_DEBUG(packet_logger, DBG_DHCP4_BASIC_DATA, DHCP4_SUBNET_SELECTED)
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC_DATA, DHCP4_SUBNET_SELECTED)
.arg(query->getLabel())
.arg(subnet->getID());
// Log detailed information about the selected subnet at the
// lower debug level.
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_DATA)
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_DATA)
.arg(query->getLabel())
.arg(subnet->toText());
} else {
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_SUBNET_SELECTION_FAILED)
.arg(query->getLabel());
}
@@ -366,7 +366,7 @@ Dhcpv4Srv::run() {
if (timeout == 0) {
timeout = 1000;
}
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT).arg(timeout);
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT).arg(timeout);
query = receivePacket(timeout);
// Log if packet has arrived. We can't log the detailed information
@@ -376,7 +376,7 @@ Dhcpv4Srv::run() {
// point are: the interface, source address and destination addresses
// and ports.
if (query) {
LOG_DEBUG(packet_logger, DBG_DHCP4_BASIC, DHCP4_BUFFER_RECEIVED)
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP4_BUFFER_RECEIVED)
.arg(query->getRemoteAddr().toText())
.arg(query->getRemotePort())
.arg(query->getLocalAddr().toText())
@@ -384,7 +384,7 @@ Dhcpv4Srv::run() {
.arg(query->getIface());
} else {
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT_INTERRUPTED)
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT_INTERRUPTED)
.arg(timeout);
}
@@ -394,11 +394,11 @@ Dhcpv4Srv::run() {
// SIGINT or SIGHUP which are handled by the server. For signals
// that are not handled by the server we rely on the default
// behavior of the system.
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT_SIGNAL)
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT_SIGNAL)
.arg(signal_set_->getNext());
} catch (const std::exception& e) {
// Log all other errors.
LOG_ERROR(packet_logger, DHCP4_BUFFER_RECEIVE_FAIL).arg(e.what());
LOG_ERROR(packet4_logger, DHCP4_BUFFER_RECEIVE_FAIL).arg(e.what());
}
// Handle next signal received by the process. It must be called after
@@ -481,14 +481,14 @@ Dhcpv4Srv::run() {
// indicated they did it
if (!skip_unpack) {
try {
LOG_DEBUG(options_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_UNPACK)
LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_UNPACK)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
.arg(query->getIface());
query->unpack();
} catch (const std::exception& e) {
// Failed to parse the packet.
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_PACKET_DROP_0001)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
@@ -524,14 +524,14 @@ Dhcpv4Srv::run() {
// We have sanity checked (in accept() that the Message Type option
// exists, so we can safely get it here.
int type = query->getType();
LOG_DEBUG(packet_logger, DBG_DHCP4_BASIC_DATA, DHCP4_PACKET_RECEIVED)
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC_DATA, DHCP4_PACKET_RECEIVED)
.arg(query->getLabel())
.arg(query->getName())
.arg(type)
.arg(query->getRemoteAddr())
.arg(query->getLocalAddr())
.arg(query->getIface());
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUERY_DATA)
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUERY_DATA)
.arg(query->getLabel())
.arg(query->toText());
@@ -600,7 +600,7 @@ Dhcpv4Srv::run() {
// (The problem is logged as a debug message because debug is
// disabled by default - it prevents a DDOS attack based on the
// sending of problem packets.)
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_BASIC,
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_BASIC,
DHCP4_PACKET_DROP_0007)
.arg(query->getLabel())
.arg(e.what());
@@ -647,11 +647,11 @@ Dhcpv4Srv::run() {
if (!skip_pack) {
try {
LOG_DEBUG(options_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_PACK)
LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_PACK)
.arg(rsp->getLabel());
rsp->pack();
} catch (const std::exception& e) {
LOG_ERROR(options_logger, DHCP4_PACKET_PACK_FAIL)
LOG_ERROR(options4_logger, DHCP4_PACKET_PACK_FAIL)
.arg(rsp->getLabel())
.arg(e.what());
}
@@ -688,7 +688,7 @@ Dhcpv4Srv::run() {
callout_handle->getArgument("response4", rsp);
}
LOG_DEBUG(packet_logger, DBG_DHCP4_BASIC, DHCP4_PACKET_SEND)
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP4_PACKET_SEND)
.arg(rsp->getLabel())
.arg(rsp->getName())
.arg(static_cast<int>(rsp->getType()))
@@ -698,7 +698,7 @@ Dhcpv4Srv::run() {
.arg(rsp->getRemotePort())
.arg(rsp->getIface());
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL_DATA,
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL_DATA,
DHCP4_RESPONSE_DATA)
.arg(rsp->getLabel())
.arg(rsp->getName())
@@ -710,7 +710,7 @@ Dhcpv4Srv::run() {
processStatsSent(rsp);
} catch (const std::exception& e) {
LOG_ERROR(packet_logger, DHCP4_PACKET_SEND_FAIL)
LOG_ERROR(packet4_logger, DHCP4_PACKET_SEND_FAIL)
.arg(rsp->getLabel())
.arg(e.what());
}
@@ -940,7 +940,7 @@ Dhcpv4Srv::processClientName(Dhcpv4Exchange& ex) {
Option4ClientFqdnPtr fqdn = boost::dynamic_pointer_cast<Option4ClientFqdn>
(ex.getQuery()->getOption(DHO_FQDN));
if (fqdn) {
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL, DHCP4_CLIENT_FQDN_PROCESS)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL, DHCP4_CLIENT_FQDN_PROCESS)
.arg(ex.getQuery()->getLabel());
processClientFqdnOption(ex);
@@ -948,7 +948,7 @@ Dhcpv4Srv::processClientName(Dhcpv4Exchange& ex) {
OptionStringPtr hostname = boost::dynamic_pointer_cast<OptionString>
(ex.getQuery()->getOption(DHO_HOST_NAME));
if (hostname) {
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL, DHCP4_CLIENT_HOSTNAME_PROCESS)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL, DHCP4_CLIENT_HOSTNAME_PROCESS)
.arg(ex.getQuery()->getLabel());
processHostnameOption(ex);
}
@@ -962,7 +962,7 @@ Dhcpv4Srv::processClientName(Dhcpv4Exchange& ex) {
// from the log. We don't want to throw an exception here because,
// it will impact the processing of the whole packet. We rather want
// the processing to continue, even if the client's name is wrong.
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_NAME_PROC_FAIL)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_NAME_PROC_FAIL)
.arg(ex.getQuery()->getLabel())
.arg(e.what());
}
@@ -974,7 +974,7 @@ Dhcpv4Srv::processClientFqdnOption(Dhcpv4Exchange& ex) {
Option4ClientFqdnPtr fqdn = boost::dynamic_pointer_cast<
Option4ClientFqdn>(ex.getQuery()->getOption(DHO_FQDN));
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_FQDN_DATA)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_FQDN_DATA)
.arg(ex.getQuery()->getLabel())
.arg(fqdn->toText());
@@ -1014,7 +1014,7 @@ Dhcpv4Srv::processClientFqdnOption(Dhcpv4Exchange& ex) {
// If we don't store the option in the response message, we will have to
// propagate it in the different way to the functions which acquire the
// lease. This would require modifications to the API of this class.
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_RESPONSE_FQDN_DATA)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_RESPONSE_FQDN_DATA)
.arg(ex.getQuery()->getLabel())
.arg(fqdn_resp->toText());
ex.getResponse()->addOption(fqdn_resp);
@@ -1026,7 +1026,7 @@ Dhcpv4Srv::processHostnameOption(Dhcpv4Exchange& ex) {
OptionStringPtr opt_hostname = boost::dynamic_pointer_cast<OptionString>
(ex.getQuery()->getOption(DHO_HOST_NAME));
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_HOSTNAME_DATA)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_CLIENT_HOSTNAME_DATA)
.arg(ex.getQuery()->getLabel())
.arg(opt_hostname->getValue());
@@ -1045,7 +1045,7 @@ Dhcpv4Srv::processHostnameOption(Dhcpv4Exchange& ex) {
/// @todo It would be more liberal to accept this and let it fall into
/// the case of replace or less than two below.
if (label_count == 0) {
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_EMPTY_HOSTNAME)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_EMPTY_HOSTNAME)
.arg(ex.getQuery()->getLabel());
return;
}
@@ -1090,7 +1090,7 @@ Dhcpv4Srv::processHostnameOption(Dhcpv4Exchange& ex) {
opt_hostname_resp->setValue(d2_mgr.qualifyName(hostname, false));
}
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_RESPONSE_HOSTNAME_DATA)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_RESPONSE_HOSTNAME_DATA)
.arg(ex.getQuery()->getLabel())
.arg(opt_hostname_resp->getValue());
ex.getResponse()->addOption(opt_hostname_resp);
@@ -1150,7 +1150,7 @@ queueNameChangeRequest(const isc::dhcp_ddns::NameChangeType chg_type,
try {
dhcid = computeDhcid(lease);
} catch (const DhcidComputeError& ex) {
LOG_ERROR(ddns_logger, DHCP4_DHCID_COMPUTE_ERROR)
LOG_ERROR(ddns4_logger, DHCP4_DHCID_COMPUTE_ERROR)
.arg(lease->toText())
.arg(ex.what());
return;
@@ -1166,7 +1166,7 @@ queueNameChangeRequest(const isc::dhcp_ddns::NameChangeType chg_type,
lease->valid_lft_),
lease->valid_lft_));
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUEUE_NCR)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUEUE_NCR)
.arg(chg_type == CHG_ADD ? "add" : "remove")
.arg(ncr->toText());
@@ -1191,7 +1191,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
// misconfiguration of the server (or some relays).
// Perhaps this should be logged on some higher level?
LOG_ERROR(bad_packet_logger, DHCP4_PACKET_NAK_0001)
LOG_ERROR(bad_packet4_logger, DHCP4_PACKET_NAK_0001)
.arg(query->getLabel())
.arg(query->getRemoteAddr().toText())
.arg(query->getName());
@@ -1244,7 +1244,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
// and whether the client is known, i.e., has a lease.
if (!fake_allocation && !opt_serverid && opt_requested_address) {
LOG_DEBUG(lease_logger, DBG_DHCP4_DETAIL, DHCP4_INIT_REBOOT)
LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_INIT_REBOOT)
.arg(query->getLabel())
.arg(hint.toText());
@@ -1261,7 +1261,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
// validating the address sent because we don't want to respond if
// we don't know this client.
if (!lease || !lease->belongsToClient(hwaddr, client_id)) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_NO_LEASE_INIT_REBOOT)
.arg(query->getLabel())
.arg(hint.toText());
@@ -1273,7 +1273,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
// We know this client so we can now check if his notion of the
// IP address is correct.
if (lease && (lease->addr_ != hint)) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_PACKET_NAK_0002)
.arg(query->getLabel())
.arg(hint.toText());
@@ -1331,7 +1331,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
if (lease) {
// We have a lease! Let's set it in the packet and send it back to
// the client.
LOG_DEBUG(lease_logger, DBG_DHCP4_BASIC_DATA, fake_allocation?
LOG_DEBUG(lease4_logger, DBG_DHCP4_BASIC_DATA, fake_allocation?
DHCP4_LEASE_ADVERT : DHCP4_LEASE_ALLOC)
.arg(query->getLabel())
.arg(lease->addr_.toText());
@@ -1364,7 +1364,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
lease->hostname_ = CfgMgr::instance().getD2ClientMgr()
.generateFqdn(lease->addr_, static_cast<bool>(fqdn));
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL, DHCP4_RESPONSE_HOSTNAME_GENERATE)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL, DHCP4_RESPONSE_HOSTNAME_GENERATE)
.arg(query->getLabel())
.arg(lease->hostname_);
@@ -1389,7 +1389,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
}
} catch (const Exception& ex) {
LOG_ERROR(ddns_logger, DHCP4_NAME_GEN_UPDATE_FAIL)
LOG_ERROR(ddns4_logger, DHCP4_NAME_GEN_UPDATE_FAIL)
.arg(query->getLabel())
.arg(lease->hostname_)
.arg(ex.what());
@@ -1424,12 +1424,12 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
// real allocation.
if (!fake_allocation && CfgMgr::instance().ddnsEnabled()) {
try {
LOG_DEBUG(ddns_logger, DBG_DHCP4_DETAIL, DHCP4_NCR_CREATE)
LOG_DEBUG(ddns4_logger, DBG_DHCP4_DETAIL, DHCP4_NCR_CREATE)
.arg(query->getLabel());
createNameChangeRequests(lease, ctx->old_lease_);
} catch (const Exception& ex) {
LOG_ERROR(ddns_logger, DHCP4_NCR_CREATION_FAILED)
LOG_ERROR(ddns4_logger, DHCP4_NCR_CREATION_FAILED)
.arg(query->getLabel())
.arg(ex.what());
}
@@ -1438,7 +1438,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
} else {
// Allocation engine did not allocate a lease. The engine logged
// cause of that failure.
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, fake_allocation ?
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, fake_allocation ?
DHCP4_PACKET_NAK_0003 : DHCP4_PACKET_NAK_0004)
.arg(query->getLabel())
.arg(query->getCiaddr().toText())
@@ -1651,7 +1651,7 @@ Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
/// doing class specific processing.
if (!classSpecificProcessing(ex)) {
/// @todo add more verbosity here
LOG_DEBUG(options_logger, DBG_DHCP4_DETAIL, DHCP4_DISCOVER_CLASS_PROCESSING_FAILED)
LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL, DHCP4_DISCOVER_CLASS_PROCESSING_FAILED)
.arg(discover->getLabel());
}
@@ -1701,7 +1701,7 @@ Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
/// doing class specific processing.
if (!classSpecificProcessing(ex)) {
/// @todo add more verbosity here
LOG_DEBUG(options_logger, DBG_DHCP4_DETAIL, DHCP4_REQUEST_CLASS_PROCESSING_FAILED)
LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL, DHCP4_REQUEST_CLASS_PROCESSING_FAILED)
.arg(ex.getQuery()->getLabel());
}
@@ -1732,7 +1732,7 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
Subnet4Ptr subnet = selectSubnet(release);
if (!subnet) {
// No subnet - release no sent from the proper location
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL,
DHCP4_RELEASE_FAIL_NO_SUBNET)
.arg(release->getLabel())
.arg(release->getCiaddr().toText());
@@ -1745,14 +1745,14 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
if (!lease) {
// No such lease - bogus release
LOG_DEBUG(lease_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_NO_LEASE)
LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_NO_LEASE)
.arg(release->getLabel())
.arg(release->getCiaddr().toText());
return;
}
if (!lease->belongsToClient(release->getHWAddr(), client_id)) {
LOG_DEBUG(lease_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_WRONG_CLIENT)
LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_WRONG_CLIENT)
.arg(release->getLabel())
.arg(release->getCiaddr().toText());
return;
@@ -1795,7 +1795,7 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
if (success) {
// Release successful
LOG_DEBUG(lease_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE)
LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE)
.arg(release->getLabel())
.arg(lease->addr_.toText());
@@ -1810,13 +1810,13 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
}
} else {
// Release failed
LOG_ERROR(lease_logger, DHCP4_RELEASE_FAIL)
LOG_ERROR(lease4_logger, DHCP4_RELEASE_FAIL)
.arg(release->getLabel())
.arg(lease->addr_.toText());
}
}
} catch (const isc::Exception& ex) {
LOG_ERROR(lease_logger, DHCP4_RELEASE_EXCEPTION)
LOG_ERROR(lease4_logger, DHCP4_RELEASE_EXCEPTION)
.arg(release->getLabel())
.arg(release->getCiaddr())
.arg(ex.what());
@@ -1848,7 +1848,7 @@ Dhcpv4Srv::processInform(Pkt4Ptr& inform) {
// be cleared (these fields were copied by the copyDefaultFields function).
// Also Relay Agent Options should be removed if present.
if (ack->getRemoteAddr() != inform->getGiaddr()) {
LOG_DEBUG(packet_logger, DBG_DHCP4_DETAIL, DHCP4_INFORM_DIRECT_REPLY)
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_INFORM_DIRECT_REPLY)
.arg(inform->getLabel())
.arg(ack->getRemoteAddr())
.arg(ack->getIface());
@@ -1863,7 +1863,7 @@ Dhcpv4Srv::processInform(Pkt4Ptr& inform) {
/// @todo: decide whether we want to add a new hook point for
/// doing class specific processing.
if (!classSpecificProcessing(ex)) {
LOG_DEBUG(options_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL,
DHCP4_INFORM_CLASS_PROCESSING_FAILED)
.arg(inform->getLabel());
}
@@ -1881,7 +1881,7 @@ Dhcpv4Srv::accept(const Pkt4Ptr& query) const {
// Check if the message from directly connected client (if directly
// connected) should be dropped or processed.
if (!acceptDirectRequest(query)) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0002)
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0002)
.arg(query->getLabel())
.arg(query->getIface());
return (false);
@@ -1890,7 +1890,7 @@ Dhcpv4Srv::accept(const Pkt4Ptr& query) const {
// Check if the DHCPv4 packet has been sent to us or to someone else.
// If it hasn't been sent to us, drop it!
if (!acceptServerId(query)) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0003)
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0003)
.arg(query->getLabel())
.arg(query->getIface());
return (false);
@@ -1934,7 +1934,7 @@ Dhcpv4Srv::acceptMessageType(const Pkt4Ptr& query) const {
type = query->getType();
} catch (...) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0004)
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0004)
.arg(query->getLabel())
.arg(query->getIface());
return (false);
@@ -1942,7 +1942,7 @@ Dhcpv4Srv::acceptMessageType(const Pkt4Ptr& query) const {
// If we receive a message with a non-existing type, we are logging it.
if (type > DHCPLEASEQUERYDONE) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0005)
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0005)
.arg(query->getLabel())
.arg(type);
return (false);
@@ -1959,7 +1959,7 @@ Dhcpv4Srv::acceptMessageType(const Pkt4Ptr& query) const {
if ((type != DHCPDISCOVER) && (type != DHCPREQUEST) &&
(type != DHCPRELEASE) && (type != DHCPDECLINE) &&
(type != DHCPINFORM)) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0006)
LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_DROP_0006)
.arg(query->getLabel())
.arg(type);
return (false);
@@ -2196,7 +2196,7 @@ void Dhcpv4Srv::classifyPacket(const Pkt4Ptr& pkt) {
}
if (!classes.empty()) {
LOG_DEBUG(options_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_ASSIGNED)
LOG_DEBUG(options4_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_ASSIGNED)
.arg(pkt->getLabel())
.arg(classes);
}
@@ -2260,7 +2260,7 @@ void
Dhcpv4Srv::d2ClientErrorHandler(const
dhcp_ddns::NameChangeSender::Result result,
dhcp_ddns::NameChangeRequestPtr& ncr) {
LOG_ERROR(ddns_logger, DHCP4_DDNS_REQUEST_SEND_FAILED).
LOG_ERROR(ddns4_logger, DHCP4_DDNS_REQUEST_SEND_FAILED).
arg(result).arg((ncr ? ncr->toText() : " NULL "));
// We cannot communicate with kea-dhcp-ddns, suspend further updates.
/// @todo We may wish to revisit this, but for now we will simply turn

View File

@@ -29,11 +29,11 @@ const char* DHCP6_DDNS_LOGGER_NAME = "ddns";
const char* DHCP6_LEASE_LOGGER_NAME = "leases";
isc::log::Logger dhcp6_logger(DHCP6_APP_LOGGER_NAME);
isc::log::Logger bad_packet_logger(DHCP6_BAD_PACKET_LOGGER_NAME);
isc::log::Logger packet_logger(DHCP6_PACKET_LOGGER_NAME);
isc::log::Logger options_logger(DHCP6_OPTIONS_LOGGER_NAME);
isc::log::Logger ddns_logger(DHCP6_DDNS_LOGGER_NAME);
isc::log::Logger lease_logger(DHCP6_LEASE_LOGGER_NAME);
isc::log::Logger bad_packet6_logger(DHCP6_BAD_PACKET_LOGGER_NAME);
isc::log::Logger packet6_logger(DHCP6_PACKET_LOGGER_NAME);
isc::log::Logger options6_logger(DHCP6_OPTIONS_LOGGER_NAME);
isc::log::Logger ddns6_logger(DHCP6_DDNS_LOGGER_NAME);
isc::log::Logger lease6_logger(DHCP6_LEASE_LOGGER_NAME);
} // namespace dhcp
} // namespace isc

View File

@@ -98,30 +98,30 @@ extern isc::log::Logger dhcp6_logger;
///
/// Here "bad packets" are packets that are either dropped (i.e malformed,
/// unsupported types) or packets that are rejected for logical reasons.
extern isc::log::Logger bad_packet_logger;
extern isc::log::Logger bad_packet6_logger;
/// @brief Logger for processed packets.
///
/// This logger is used to issue log messages related to the reception and
/// sending DHCP packets.
extern isc::log::Logger packet_logger;
extern isc::log::Logger packet6_logger;
/// @brief Logger for options parser.
///
/// This logger is used to issue log messages related to processing of the
/// DHCP options
extern isc::log::Logger options_logger;
extern isc::log::Logger options6_logger;
/// @brief Logger for Hostname or FQDN processing.
///
/// This logger is used to issue log messages related to processing the
/// hostnames, FQDNs and sending name change requests to D2.
extern isc::log::Logger ddns_logger;
extern isc::log::Logger ddns6_logger;
/// @brief Logger for lease allocation logic.
///
/// This logger is used to issue log messages related to lease allocation.
extern isc::log::Logger lease_logger;
extern isc::log::Logger lease6_logger;
//@}

View File

@@ -130,7 +130,7 @@ createStatusCode(const Pkt6& pkt, const uint16_t status_code,
const std::string& status_message) {
Option6StatusCodePtr option_status(new Option6StatusCode(status_code,
status_message));
LOG_DEBUG(options_logger, DBG_DHCP6_DETAIL, DHCP6_ADD_GLOBAL_STATUS_CODE)
LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL, DHCP6_ADD_GLOBAL_STATUS_CODE)
.arg(pkt.getLabel())
.arg(option_status->dataToText());
return (option_status);
@@ -155,7 +155,7 @@ createStatusCode(const Pkt6& pkt, const Option6IA& ia, const uint16_t status_cod
const std::string& status_message) {
Option6StatusCodePtr option_status(new Option6StatusCode(status_code,
status_message));
LOG_DEBUG(options_logger, DBG_DHCP6_DETAIL, DHCP6_ADD_STATUS_CODE_FOR_IA)
LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL, DHCP6_ADD_STATUS_CODE_FOR_IA)
.arg(pkt.getLabel())
.arg(ia.getIAID())
.arg(option_status->dataToText());
@@ -261,7 +261,7 @@ Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
// Let us test received ServerID if it is same as ServerID
// which is being used by server
if (getServerID()->getData() != server_id->getData()){
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_DETAIL_DATA,
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_DETAIL_DATA,
DHCP6_PACKET_DROP_SERVERID_MISMATCH)
.arg(pkt->getLabel())
.arg(duidToString(server_id))
@@ -281,7 +281,7 @@ Dhcpv6Srv::testUnicast(const Pkt6Ptr& pkt) const {
case DHCPV6_REBIND:
case DHCPV6_INFORMATION_REQUEST:
if (pkt->relay_info_.empty() && !pkt->getLocalAddr().isV6Multicast()) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_DETAIL, DHCP6_PACKET_DROP_UNICAST)
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_DETAIL, DHCP6_PACKET_DROP_UNICAST)
.arg(pkt->getLabel())
.arg(pkt->getName());
return (false);
@@ -323,7 +323,7 @@ bool Dhcpv6Srv::run() {
if (timeout == 0) {
timeout = 1000;
}
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT).arg(timeout);
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT).arg(timeout);
query = receivePacket(timeout);
// Log if packet has arrived. We can't log the detailed information
@@ -333,7 +333,7 @@ bool Dhcpv6Srv::run() {
// point are: the interface, source address and destination addresses
// and ports.
if (query) {
LOG_DEBUG(packet_logger, DBG_DHCP6_BASIC, DHCP6_BUFFER_RECEIVED)
LOG_DEBUG(packet6_logger, DBG_DHCP6_BASIC, DHCP6_BUFFER_RECEIVED)
.arg(query->getRemoteAddr().toText())
.arg(query->getRemotePort())
.arg(query->getLocalAddr().toText())
@@ -347,7 +347,7 @@ bool Dhcpv6Srv::run() {
StatsMgr::instance().addValue("pkt6-received", static_cast<int64_t>(1));
} else {
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT_INTERRUPTED)
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT_INTERRUPTED)
.arg(timeout);
}
@@ -357,10 +357,10 @@ bool Dhcpv6Srv::run() {
// SIGINT or SIGHUP which are handled by the server. For signals
// that are not handled by the server we rely on the default
// behavior of the system.
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT_SIGNAL)
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_WAIT_SIGNAL)
.arg(signal_set_->getNext());
} catch (const std::exception& e) {
LOG_ERROR(packet_logger, DHCP6_PACKET_RECEIVE_FAIL).arg(e.what());
LOG_ERROR(packet6_logger, DHCP6_PACKET_RECEIVE_FAIL).arg(e.what());
}
// Handle next signal received by the process. It must be called after
@@ -434,14 +434,14 @@ bool Dhcpv6Srv::run() {
// indicated they did it
if (!skip_unpack) {
try {
LOG_DEBUG(options_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_UNPACK)
LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_UNPACK)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
.arg(query->getIface());
query->unpack();
} catch (const std::exception &e) {
// Failed to parse the packet.
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_DETAIL,
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_DETAIL,
DHCP6_PACKET_DROP_PARSE_FAIL)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
@@ -479,14 +479,14 @@ bool Dhcpv6Srv::run() {
continue;
}
LOG_DEBUG(packet_logger, DBG_DHCP6_BASIC_DATA, DHCP6_PACKET_RECEIVED)
LOG_DEBUG(packet6_logger, DBG_DHCP6_BASIC_DATA, DHCP6_PACKET_RECEIVED)
.arg(query->getLabel())
.arg(query->getName())
.arg(query->getType())
.arg(query->getRemoteAddr())
.arg(query->getLocalAddr())
.arg(query->getIface());
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_QUERY_DATA)
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_QUERY_DATA)
.arg(query->getLabel())
.arg(query->toText());
@@ -558,7 +558,7 @@ bool Dhcpv6Srv::run() {
default:
// We received a packet type that we do not recognize.
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_BASIC, DHCP6_UNKNOWN_MSG_RECEIVED)
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_BASIC, DHCP6_UNKNOWN_MSG_RECEIVED)
.arg(static_cast<int>(query->getType()))
.arg(query->getIface());
// Only action is to output a message if debug is enabled,
@@ -568,7 +568,7 @@ bool Dhcpv6Srv::run() {
}
} catch (const RFCViolation& e) {
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_BASIC, DHCP6_REQUIRED_OPTIONS_CHECK_FAIL)
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_BASIC, DHCP6_REQUIRED_OPTIONS_CHECK_FAIL)
.arg(query->getName())
.arg(query->getRemoteAddr().toText())
.arg(e.what());
@@ -584,7 +584,7 @@ bool Dhcpv6Srv::run() {
// (The problem is logged as a debug message because debug is
// disabled by default - it prevents a DDOS attack based on the
// sending of problem packets.)
LOG_DEBUG(bad_packet_logger, DBG_DHCP6_BASIC, DHCP6_PACKET_PROCESS_FAIL)
LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_BASIC, DHCP6_PACKET_PROCESS_FAIL)
.arg(query->getName())
.arg(query->getRemoteAddr().toText())
.arg(e.what());
@@ -653,7 +653,7 @@ bool Dhcpv6Srv::run() {
}
}
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL_DATA,
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL_DATA,
DHCP6_RESPONSE_DATA)
.arg(static_cast<int>(rsp->getType())).arg(rsp->toText());
@@ -661,7 +661,7 @@ bool Dhcpv6Srv::run() {
try {
rsp->pack();
} catch (const std::exception& e) {
LOG_ERROR(options_logger, DHCP6_PACK_FAIL)
LOG_ERROR(options6_logger, DHCP6_PACK_FAIL)
.arg(e.what());
continue;
}
@@ -698,7 +698,7 @@ bool Dhcpv6Srv::run() {
callout_handle->getArgument("response6", rsp);
}
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL_DATA,
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL_DATA,
DHCP6_RESPONSE_DATA)
.arg(static_cast<int>(rsp->getType())).arg(rsp->toText());
@@ -708,7 +708,7 @@ bool Dhcpv6Srv::run() {
processStatsSent(rsp);
} catch (const std::exception& e) {
LOG_ERROR(packet_logger, DHCP6_PACKET_SEND_FAIL)
LOG_ERROR(packet6_logger, DHCP6_PACKET_SEND_FAIL)
.arg(e.what());
}
}
@@ -1091,17 +1091,17 @@ Dhcpv6Srv::selectSubnet(const Pkt6Ptr& question) {
if (subnet) {
// Log at higher debug level that subnet has been found.
LOG_DEBUG(packet_logger, DBG_DHCP6_BASIC_DATA, DHCP6_SUBNET_SELECTED)
LOG_DEBUG(packet6_logger, DBG_DHCP6_BASIC_DATA, DHCP6_SUBNET_SELECTED)
.arg(question->getLabel())
.arg(subnet->getID());
// Log detailed information about the selected subnet at the
// lower debug level.
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_SUBNET_DATA)
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_SUBNET_DATA)
.arg(question->getLabel())
.arg(subnet->toText());
} else {
LOG_DEBUG(packet_logger, DBG_DHCP6_DETAIL, DHCP6_SUBNET_SELECTION_FAILED)
LOG_DEBUG(packet6_logger, DBG_DHCP6_DETAIL, DHCP6_SUBNET_SELECTION_FAILED)
.arg(question->getLabel());
}
@@ -1168,7 +1168,7 @@ Dhcpv6Srv::processClientFqdn(const Pkt6Ptr& question, const Pkt6Ptr& answer,
return;
}
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_RECEIVE_FQDN)
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_RECEIVE_FQDN)
.arg(question->getLabel())
.arg(fqdn->toText());
@@ -1203,7 +1203,7 @@ Dhcpv6Srv::processClientFqdn(const Pkt6Ptr& question, const Pkt6Ptr& answer,
// response to be sent to a client. Note that the Client FQDN option is
// always sent back to the client if Client FQDN was included in the
// client's message.
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_RESPONSE_FQDN_DATA)
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_RESPONSE_FQDN_DATA)
.arg(question->getLabel())
.arg(fqdn_resp->toText());
answer->addOption(fqdn_resp);
@@ -1293,7 +1293,7 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer) {
iaaddr->getAddress().toText(),
dhcid, 0, iaaddr->getValid()));
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL,
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL,
DHCP6_DDNS_CREATE_ADD_NAME_CHANGE_REQUEST).arg(ncr->toText());
// Post the NCR to the D2ClientMgr.
@@ -1312,7 +1312,7 @@ Dhcpv6Srv::createRemovalNameChangeRequest(const Pkt6Ptr& query, const Lease6Ptr&
// Don't create NameChangeRequests if DNS updates are disabled
// or DNS update hasn't been performed.
if (!CfgMgr::instance().ddnsEnabled() || (!lease->fqdn_fwd_ && !lease->fqdn_rev_)) {
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL_DATA,
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL_DATA,
DHCP6_DDNS_SKIP_REMOVE_NAME_CHANGE_REQUEST)
.arg(query->getLabel())
.arg(lease->toText());
@@ -1331,7 +1331,7 @@ Dhcpv6Srv::createRemovalNameChangeRequest(const Pkt6Ptr& query, const Lease6Ptr&
OptionDataTypeUtil::writeFqdn(lease->hostname_, hostname_wire, true);
} catch (const Exception& ex) {
LOG_ERROR(ddns_logger, DHCP6_DDNS_REMOVE_INVALID_HOSTNAME)
LOG_ERROR(ddns6_logger, DHCP6_DDNS_REMOVE_INVALID_HOSTNAME)
.arg(query->getLabel())
.arg(lease->hostname_.empty() ? "(empty)" : lease->hostname_)
.arg(lease->addr_.toText());
@@ -1356,7 +1356,7 @@ Dhcpv6Srv::createRemovalNameChangeRequest(const Pkt6Ptr& query, const Lease6Ptr&
lease->addr_.toText(),
dhcid, 0, lease->valid_lft_));
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL,
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL,
DHCP6_DDNS_CREATE_REMOVE_NAME_CHANGE_REQUEST)
.arg(query->getLabel())
.arg(ncr->toText());
@@ -1395,7 +1395,7 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
hint = hint_opt->getAddress();
}
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST)
.arg(query->getLabel())
.arg(ia->getIAID())
.arg(hint_opt ? hint.toText() : "(no hint)");
@@ -1474,12 +1474,12 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
if (lease) {
// We have a lease! Let's wrap its content into IA_NA option
// with IAADDR suboption.
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, fake_allocation ?
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, fake_allocation ?
DHCP6_LEASE_ADVERT : DHCP6_LEASE_ALLOC)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(ia->getIAID());
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_LEASE_DATA)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_LEASE_DATA)
.arg(query->getLabel())
.arg(ia->getIAID())
.arg(lease->toText());
@@ -1522,7 +1522,7 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
// cause of that failure. The only thing left is to insert
// status code to pass the sad news to the client.
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, fake_allocation ?
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, fake_allocation ?
DHCP6_LEASE_ADVERT_FAIL : DHCP6_LEASE_ALLOC_FAIL)
.arg(query->getLabel())
.arg(ia->getIAID());
@@ -1540,7 +1540,7 @@ Dhcpv6Srv::conditionalNCRRemoval(const Pkt6Ptr& query, Lease6Ptr& old_lease,
Lease6Ptr& new_lease, const std::string& hostname,
bool do_fwd, bool do_rev) {
if (old_lease && !new_lease->hasIdenticalFqdn(*old_lease)) {
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_LEASE_ASSIGN_FQDN_CHANGE)
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL, DHCP6_DDNS_LEASE_ASSIGN_FQDN_CHANGE)
.arg(query->getLabel())
.arg(old_lease->toText())
.arg(hostname)
@@ -1568,7 +1568,7 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, const Pkt6Ptr& answer,
hint = hint_opt->getAddress();
}
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST)
.arg(query->getLabel())
.arg(ia->getIAID())
.arg(hint_opt ? hint.toText() : "(no hint)");
@@ -1630,7 +1630,7 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, const Pkt6Ptr& answer,
// We have a lease! Let's wrap its content into IA_PD option
// with IAADDR suboption.
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, fake_allocation ?
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, fake_allocation ?
DHCP6_PD_LEASE_ADVERT : DHCP6_PD_LEASE_ALLOC)
.arg(query->getLabel())
.arg((*l)->addr_.toText())
@@ -1653,7 +1653,7 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, const Pkt6Ptr& answer,
// cause of that failure. The only thing left is to insert
// status code to pass the sad news to the client.
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, fake_allocation ?
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, fake_allocation ?
DHCP6_PD_LEASE_ADVERT_FAIL : DHCP6_PD_LEASE_ALLOC_FAIL)
.arg(query->getLabel())
.arg(ia->getIAID());
@@ -1671,7 +1671,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
AllocEngine::ClientContext6& orig_ctx,
boost::shared_ptr<Option6IA> ia) {
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_EXTEND)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_EXTEND)
.arg(query->getLabel())
.arg(ia->getIAID());
@@ -1790,7 +1790,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
// delete any existing FQDN records for this lease.
if (((*l)->hostname_ != ctx.hostname_) || ((*l)->fqdn_fwd_ != do_fwd) ||
((*l)->fqdn_rev_ != do_rev)) {
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL,
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL,
DHCP6_DDNS_LEASE_RENEW_FQDN_CHANGE)
.arg(query->getLabel())
.arg((*l)->toText())
@@ -1822,7 +1822,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
ia_rsp->addOption(createStatusCode(*query, *ia_rsp, STATUS_NoBinding,
"Sorry, no known leases for this duid/iaid/subnet."));
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_EXTEND_NA_UNKNOWN)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_EXTEND_NA_UNKNOWN)
.arg(query->getLabel())
.arg(ia->getIAID())
.arg(subnet->toText());
@@ -1843,7 +1843,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
AllocEngine::ClientContext6& orig_ctx,
boost::shared_ptr<Option6IA> ia) {
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_EXTEND)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_EXTEND)
.arg(query->getLabel())
.arg(ia->getIAID());
@@ -2109,7 +2109,7 @@ OptionPtr
Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
int& general_status, boost::shared_ptr<Option6IA> ia) {
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_RELEASE)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_RELEASE)
.arg(query->getLabel())
.arg(ia->getIAID());
@@ -2154,7 +2154,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
// have mandatory DUID information attached. Someone was messing with our
// database.
LOG_ERROR(lease_logger, DHCP6_LEASE_NA_WITHOUT_DUID)
LOG_ERROR(lease6_logger, DHCP6_LEASE_NA_WITHOUT_DUID)
.arg(query->getLabel())
.arg(release_addr->getAddress().toText());
@@ -2167,7 +2167,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
if (*duid != *(lease->duid_)) {
// Sorry, it's not your address. You can't release it.
LOG_INFO(lease_logger, DHCP6_RELEASE_NA_FAIL_WRONG_DUID)
LOG_INFO(lease6_logger, DHCP6_RELEASE_NA_FAIL_WRONG_DUID)
.arg(query->getLabel())
.arg(release_addr->getAddress().toText())
.arg(lease->duid_->toText());
@@ -2180,7 +2180,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
if (ia->getIAID() != lease->iaid_) {
// This address belongs to this client, but to a different IA
LOG_WARN(lease_logger, DHCP6_RELEASE_NA_FAIL_WRONG_IAID)
LOG_WARN(lease6_logger, DHCP6_RELEASE_NA_FAIL_WRONG_IAID)
.arg(query->getLabel())
.arg(release_addr->getAddress().toText())
.arg(lease->iaid_)
@@ -2235,7 +2235,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
ia_rsp->addOption(createStatusCode(*query, *ia_rsp, STATUS_UnspecFail,
"Server failed to release a lease"));
LOG_ERROR(lease_logger, DHCP6_RELEASE_NA_FAIL)
LOG_ERROR(lease6_logger, DHCP6_RELEASE_NA_FAIL)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(lease->iaid_);
@@ -2243,7 +2243,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
return (ia_rsp);
} else {
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_RELEASE_NA)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_RELEASE_NA)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(lease->iaid_);
@@ -2308,7 +2308,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
// Something is gravely wrong here. We do have a lease, but it does not
// have mandatory DUID information attached. Someone was messing with our
// database.
LOG_ERROR(lease_logger, DHCP6_LEASE_PD_WITHOUT_DUID)
LOG_ERROR(lease6_logger, DHCP6_LEASE_PD_WITHOUT_DUID)
.arg(query->getLabel())
.arg(release_prefix->getAddress().toText())
.arg(static_cast<int>(release_prefix->getLength()));
@@ -2321,7 +2321,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
if (*duid != *(lease->duid_)) {
// Sorry, it's not your address. You can't release it.
LOG_INFO(lease_logger, DHCP6_RELEASE_PD_FAIL_WRONG_DUID)
LOG_INFO(lease6_logger, DHCP6_RELEASE_PD_FAIL_WRONG_DUID)
.arg(query->getLabel())
.arg(release_prefix->getAddress().toText())
.arg(static_cast<int>(release_prefix->getLength()))
@@ -2335,7 +2335,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
if (ia->getIAID() != lease->iaid_) {
// This address belongs to this client, but to a different IA
LOG_WARN(lease_logger, DHCP6_RELEASE_PD_FAIL_WRONG_IAID)
LOG_WARN(lease6_logger, DHCP6_RELEASE_PD_FAIL_WRONG_IAID)
.arg(query->getLabel())
.arg(release_prefix->getAddress().toText())
.arg(static_cast<int>(release_prefix->getLength()))
@@ -2390,7 +2390,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
ia_rsp->addOption(createStatusCode(*query, *ia_rsp, STATUS_UnspecFail,
"Server failed to release a lease"));
LOG_ERROR(lease_logger, DHCP6_RELEASE_PD_FAIL)
LOG_ERROR(lease6_logger, DHCP6_RELEASE_PD_FAIL)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(static_cast<int>(lease->prefixlen_))
@@ -2398,7 +2398,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
general_status = STATUS_UnspecFail;
} else {
LOG_DEBUG(lease_logger, DBG_DHCP6_DETAIL, DHCP6_RELEASE_PD)
LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_RELEASE_PD)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(static_cast<int>(lease->prefixlen_))
@@ -2433,9 +2433,8 @@ Dhcpv6Srv::processSolicit(const Pkt6Ptr& solicit) {
OptionPtr opt_rapid_commit = solicit->getOption(D6O_RAPID_COMMIT);
if (opt_rapid_commit) {
/// @todo uncomment when #3807 is merged!
/* LOG_DEBUG(options_logger, DBG_DHCP6_DETAIL, DHCP6_RAPID_COMMIT)
.arg(solicit->getLabel()); */
LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL, DHCP6_RAPID_COMMIT)
.arg(solicit->getLabel());
// If Rapid Commit has been sent by the client, change the
// response type to Reply and include Rapid Commit option.
@@ -2827,7 +2826,7 @@ Dhcpv6Srv::generateFqdn(const Pkt6Ptr& answer) {
std::string generated_name =
CfgMgr::instance().getD2ClientMgr().generateFqdn(addr);
LOG_DEBUG(ddns_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_DDNS_FQDN_GENERATED)
LOG_DEBUG(ddns6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_DDNS_FQDN_GENERATED)
.arg(answer->getLabel())
.arg(generated_name);
@@ -2856,7 +2855,7 @@ Dhcpv6Srv::generateFqdn(const Pkt6Ptr& answer) {
fqdn->setDomainName(generated_name, Option6ClientFqdn::FULL);
} catch (const Exception& ex) {
LOG_ERROR(ddns_logger, DHCP6_DDNS_GENERATED_FQDN_UPDATE_FAIL)
LOG_ERROR(ddns6_logger, DHCP6_DDNS_GENERATED_FQDN_UPDATE_FAIL)
.arg(answer->getLabel())
.arg(addr.toText())
.arg(ex.what());
@@ -2879,7 +2878,7 @@ void
Dhcpv6Srv::d2ClientErrorHandler(const
dhcp_ddns::NameChangeSender::Result result,
dhcp_ddns::NameChangeRequestPtr& ncr) {
LOG_ERROR(ddns_logger, DHCP6_DDNS_REQUEST_SEND_FAILED).
LOG_ERROR(ddns6_logger, DHCP6_DDNS_REQUEST_SEND_FAILED).
arg(result).arg((ncr ? ncr->toText() : " NULL "));
// We cannot communicate with kea-dhcp-ddns, suspend further updates.
/// @todo We may wish to revisit this, but for now we will simply turn