Browse Source

[3036] Added a few logging messages concerning changes to DNS mapping.

Marcin Siodelski 11 years ago
parent
commit
943e416451
2 changed files with 52 additions and 0 deletions
  1. 25 0
      src/bin/dhcp6/dhcp6_messages.mes
  2. 27 0
      src/bin/dhcp6/dhcp6_srv.cc

+ 25 - 0
src/bin/dhcp6/dhcp6_messages.mes

@@ -65,6 +65,31 @@ This informational message is printed every time the IPv6 DHCP server
 is started.  It indicates what database backend type is being to store
 lease and other information.
 
+% DHCP6_DDNS_CREATE_ADD_NAME_CHANGE_REQUEST created name change request: %1
+This debug message is logged when the new Name Change Request has been created
+to perform the DNS Update, which adds new RRs.
+
+% DHCP6_DDNS_CREATE_REMOVE_NAME_CHANGE_REQUEST created name change request: %1
+This debug message is logged when the new Name Change Request has been created
+to perform the DNS Update, which removes RRs from the DNS.
+
+% DHCP6_DDNS_LEASE_ASSIGN_FQDN_CHANGE FQDN for the allocated lease: %1 has changed. New values: hostname = %2, reverse mapping = %3, forward mapping = %4
+This debug message is logged when FQDN mapping for a particular lease has
+been changed by the recent Request message. This mapping will be changed in DNS.
+
+% DHCP6_DDNS_LEASE_RENEW_FQDN_CHANGE FQDN for the renewed lease: %1 has changed.
+New  values: hostname = %2, reverse mapping = %3, forward mapping = %4
+This debug message is logged when FQDN mapping for a particular lease has been
+changed by the recent Renew message. This mapping will be changed in DNS.
+
+% DHCP6_DDNS_SEND_FQDN sending DHCPv6 Client FQDN Option to the client: %1
+This debug message is logged when server includes an DHCPv6 Client FQDN Option
+in its response to the client.
+
+% DHCP6_DDNS_RECEIVE_FQDN received DHCPv6 Client FQDN Option: %1
+This debug message is logged when server has found the DHCPv6 Client FQDN Option
+sent by a client and started processing it.
+
 % DHCP6_DDNS_REMOVE_EMPTY_HOSTNAME FQDN for the lease being deleted is empty: %1
 This error message is issued when a lease being deleted contains an indication
 that the DNS Update has been performed for it, but the FQDN is missing for this

+ 27 - 0
src/bin/dhcp6/dhcp6_srv.cc

@@ -677,6 +677,10 @@ Dhcpv6Srv::processClientFqdn(const Pkt6Ptr& question) {
         return (fqdn);
     }
 
+    LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+              DHCP6_DDNS_RECEIVE_FQDN).arg(fqdn->toText());
+
+
     // Prepare the FQDN option which will be included in the response to
     // the client.
     Option6ClientFqdnPtr fqdn_resp(new Option6ClientFqdn(*fqdn));
@@ -775,6 +779,8 @@ Dhcpv6Srv::appendClientFqdn(const Pkt6Ptr& question,
     }
 
     if (include_fqdn) {
+        LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+                  DHCP6_DDNS_SEND_FQDN).arg(fqdn->toText());
         answer->addOption(fqdn);
     }
 
@@ -849,6 +855,9 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer,
         // the code and all requests from this queue will be sent to the
         // D2 module.
         name_change_reqs_.push(ncr);
+
+        LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+                  DHCP6_DDNS_CREATE_ADD_NAME_CHANGE_REQUEST).arg(ncr.toText());
     }
 }
 
@@ -899,6 +908,10 @@ Dhcpv6Srv::createRemovalNameChangeRequest(const Lease6Ptr& lease) {
                           lease->addr_.toText(),
                           dhcid, 0, lease->valid_lft_);
     name_change_reqs_.push(ncr);
+
+    LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+              DHCP6_DDNS_CREATE_REMOVE_NAME_CHANGE_REQUEST).arg(ncr.toText());
+
 }
 
 
@@ -1019,6 +1032,13 @@ Dhcpv6Srv::assignIA_NA(const Subnet6Ptr& subnet, const DuidPtr& duid,
         // DNS records and update the lease with the new settings.
         if ((lease->hostname_ != hostname) || (lease->fqdn_fwd_ != do_fwd) ||
             (lease->fqdn_rev_ != do_rev)) {
+            LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+                      DHCP6_DDNS_LEASE_ASSIGN_FQDN_CHANGE)
+                .arg(lease->toText())
+                .arg(hostname)
+                .arg(do_rev ? "true" : "false")
+                .arg(do_fwd ? "true" : "false");
+
             // Schedule removal of the existing lease.
             createRemovalNameChangeRequest(lease);
             // Set the new lease properties and update.
@@ -1110,6 +1130,13 @@ Dhcpv6Srv::renewIA_NA(const Subnet6Ptr& subnet, const DuidPtr& duid,
     // delete any existing FQDN records for this lease.
     if ((lease->hostname_ != hostname) || (lease->fqdn_fwd_ != do_fwd) ||
         (lease->fqdn_rev_ != do_rev)) {
+        LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
+                  DHCP6_DDNS_LEASE_RENEW_FQDN_CHANGE)
+            .arg(lease->toText())
+            .arg(hostname)
+            .arg(do_rev ? "true" : "false")
+            .arg(do_fwd ? "true" : "false");
+
         createRemovalNameChangeRequest(lease);
     }