Browse Source

[master] Merge branch 'trac5264'

Marcin Siodelski 8 years ago
parent
commit
2fb9fd78e6
2 changed files with 79 additions and 2 deletions
  1. 50 1
      src/lib/dhcpsrv/host_mgr.cc
  2. 29 1
      src/lib/dhcpsrv/hosts_messages.mes

+ 50 - 1
src/lib/dhcpsrv/host_mgr.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -131,9 +131,33 @@ HostMgr::get4(const SubnetID& subnet_id,
     ConstHostPtr host = getCfgHosts()->get4(subnet_id, identifier_type,
     ConstHostPtr host = getCfgHosts()->get4(subnet_id, identifier_type,
                                             identifier_begin, identifier_len);
                                             identifier_begin, identifier_len);
     if (!host && alternate_source_) {
     if (!host && alternate_source_) {
+
+        LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE,
+                  HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER)
+            .arg(subnet_id)
+            .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                           identifier_len));
+
         host = alternate_source_->get4(subnet_id, identifier_type,
         host = alternate_source_->get4(subnet_id, identifier_type,
                                        identifier_begin, identifier_len);
                                        identifier_begin, identifier_len);
+
+        if (host) {
+            LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
+                      HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER_HOST)
+                .arg(subnet_id)
+                .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                               identifier_len))
+                .arg(host->toText());
+
+        } else {
+            LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
+                      HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER_NULL)
+                .arg(subnet_id)
+                .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                               identifier_len));
+        }
     }
     }
+
     return (host);
     return (host);
 }
 }
 
 
@@ -193,8 +217,33 @@ HostMgr::get6(const SubnetID& subnet_id,
     ConstHostPtr host = getCfgHosts()->get6(subnet_id, identifier_type,
     ConstHostPtr host = getCfgHosts()->get6(subnet_id, identifier_type,
                                             identifier_begin, identifier_len);
                                             identifier_begin, identifier_len);
     if (!host && alternate_source_) {
     if (!host && alternate_source_) {
+
+        LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE,
+                  HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER)
+            .arg(subnet_id)
+            .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                           identifier_len));
+
+
         host = alternate_source_->get6(subnet_id, identifier_type,
         host = alternate_source_->get6(subnet_id, identifier_type,
                                        identifier_begin, identifier_len);
                                        identifier_begin, identifier_len);
+
+        if (host) {
+            LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
+                      HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER_HOST)
+                .arg(subnet_id)
+                .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                               identifier_len))
+                .arg(host->toText());
+
+        } else {
+            LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
+                      HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER_NULL)
+                .arg(subnet_id)
+                .arg(Host::getIdentifierAsText(identifier_type, identifier_begin,
+                                               identifier_len));
+        }
+
     }
     }
     return (host);
     return (host);
 }
 }

+ 29 - 1
src/lib/dhcpsrv/hosts_messages.mes

@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
 #
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -146,6 +146,34 @@ host connected to the specific subnet and identified by the HW address
 or DUID, and it is starting to search for this host in the alternate
 or DUID, and it is starting to search for this host in the alternate
 host data source.
 host data source.
 
 
+% HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id %1, identified by %2
+This debug message is issued when starting to retrieve a host holding
+IPv4 reservation, which is connected to a specific subnet and
+is identified by a specific unique identifier.
+
+% HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER_HOST using subnet id %1 and identifier %2, found host: %3
+This debug message includes the details of a host returned by an
+alternate hosts data source using a subnet id and specific host
+identifier.
+
+% HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id %1 and identifier %2
+This debug message is issued when no host was found using the specified
+subnet id and host identifier.
+
+% HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER get one host with IPv6 reservation for subnet id %1, identified by %2
+This debug message is issued when starting to retrieve a host holding
+IPv4 reservation, which is connected to a specific subnet and
+is identified by a specific unique identifier.
+
+% HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER_HOST using subnet id %1 and identifier %2, found host: %3
+This debug message includes the details of a host returned by an
+alternate hosts data source using a subnet id and specific host
+identifier.
+
+% HOSTS_MGR_ALTERNATE_GET6_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id %1 and identifier %2
+This debug message is issued when no host was found using the specified
+subnet id and host identifier.
+
 % HOSTS_MGR_ALTERNATE_GET6_PREFIX trying alternate source for host using prefix %1/%2
 % HOSTS_MGR_ALTERNATE_GET6_PREFIX trying alternate source for host using prefix %1/%2
 This debug message is issued when the Host Manager doesn't find the
 This debug message is issued when the Host Manager doesn't find the
 host connected to the specific subnet and having the reservation for
 host connected to the specific subnet and having the reservation for