38template<
typename LeasePtrType,
typename IdentifierType>
39void queueNCRCommon(
const NameChangeType& chg_type,
const LeasePtrType& lease,
40 const IdentifierType& identifier,
const std::string& label,
41 const bool use_conflict_resolution =
true) {
44 if (lease->hostname_.empty() || (!lease->fqdn_fwd_ && !lease->fqdn_rev_)
45 || !CfgMgr::instance().getD2ClientMgr().ddnsEnabled()) {
49 .arg(lease->addr_.toText());
56 std::vector<uint8_t> hostname_wire;
57 OptionDataTypeUtil::writeFqdn(lease->hostname_, hostname_wire,
true);
66 lease->hostname_, lease->addr_.toText(),
67 dhcid, lease->cltt_ + ttl,
68 ttl, use_conflict_resolution));
72 .arg(chg_type ==
CHG_ADD ?
"add" :
"remove")
76 CfgMgr::instance().getD2ClientMgr().sendRequest(ncr);
78 }
catch (
const std::exception& ex) {
81 .arg(chg_type ==
CHG_ADD ?
"add" :
"remove")
82 .arg(lease->addr_.toText())
98 ->getCfgSubnets4()->getSubnet(lease->subnet_id_);
101 use_cr = subnet->getDdnsUseConflictResolution();
105 if (lease->client_id_) {
106 queueNCRCommon(chg_type, lease, lease->client_id_->getClientId(),
112 queueNCRCommon(chg_type, lease, lease->hwaddr_,
125 ->getCfgSubnets6()->getSubnet(lease->subnet_id_);
128 use_cr = subnet->getDdnsUseConflictResolution();
131 queueNCRCommon(chg_type, lease, *(lease->duid_),
139 if (lease_lft < 1800) {
143 return (lease_lft / 3);
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
static std::string makeLabel(const HWAddrPtr &hwaddr, const ClientIdPtr &client_id, const uint32_t transid)
Returns text representation of the given packet identifiers.
static std::string makeLabel(const DuidPtr duid, const uint32_t transid, const HWAddrPtr &hwaddr)
Returns text representation of the given packet identifiers.
Container class for handling the DHCID value within a NameChangeRequest.
Represents a DHCP-DDNS client request.
Defines the D2ClientMgr class.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
NameChangeType
Defines the types of DNS updates that can be requested.
const int DHCPSRV_DBG_TRACE_DETAIL_DATA
Additional information.
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
const isc::log::MessageID DHCPSRV_QUEUE_NCR
void queueNCR(const NameChangeType &chg_type, const Lease4Ptr &lease)
Creates name change request from the DHCPv4 lease.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
const isc::log::MessageID DHCPSRV_QUEUE_NCR_FAILED
const int DHCPSRV_DBG_TRACE_DETAIL
Additional information.
uint32_t calculateDdnsTtl(uint32_t lease_lft)
Calculates TTL for a DNS resource record based on lease life time.
const isc::log::MessageID DHCPSRV_QUEUE_NCR_SKIP
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Defines the logger used by the top-level component of kea-lfc.
@ TYPE_PD
the lease contains IPv6 prefix (for prefix delegation)