Browse Source

[3699] Added traces for cases when no host is found.

Marcin Siodelski 10 years ago
parent
commit
da05ae7073
2 changed files with 18 additions and 3 deletions
  1. 10 3
      src/lib/dhcpsrv/cfg_hosts.cc
  2. 8 0
      src/lib/dhcpsrv/hosts_messages.mes

+ 10 - 3
src/lib/dhcpsrv/cfg_hosts.cc

@@ -233,7 +233,7 @@ CfgHosts::get4(const SubnetID& subnet_id, const IOAddress& address) const {
     for (ConstHostCollection::const_iterator host = hosts.begin();
     for (ConstHostCollection::const_iterator host = hosts.begin();
          host != hosts.end(); ++host) {
          host != hosts.end(); ++host) {
         if ((*host)->getIPv4SubnetID() == subnet_id) {
         if ((*host)->getIPv4SubnetID() == subnet_id) {
-            LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE_DETAIL_DATA,
+            LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
                       HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_HOST)
                       HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_HOST)
                 .arg(subnet_id)
                 .arg(subnet_id)
                 .arg(address.toText())
                 .arg(address.toText())
@@ -241,6 +241,9 @@ CfgHosts::get4(const SubnetID& subnet_id, const IOAddress& address) const {
             return (*host);
             return (*host);
         }
         }
     }
     }
+
+    LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS, HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_NULL)
+        .arg(subnet_id).arg(address.toText());
     return (ConstHostPtr());
     return (ConstHostPtr());
 }
 }
 
 
@@ -297,10 +300,14 @@ CfgHosts::getHostInternal6(const SubnetID& subnet_id,
     getAllInternal6<Storage>(subnet_id, address, storage);
     getAllInternal6<Storage>(subnet_id, address, storage);
     switch (storage.size()) {
     switch (storage.size()) {
     case 0:
     case 0:
+        LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
+                  HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_NULL)
+            .arg(subnet_id)
+            .arg(address.toText());
         return (HostPtr());
         return (HostPtr());
 
 
     case 1:
     case 1:
-        LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE_DETAIL_DATA,
+        LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
                   HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_HOST)
                   HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_HOST)
             .arg(subnet_id)
             .arg(subnet_id)
             .arg(address.toText())
             .arg(address.toText())
@@ -403,7 +410,7 @@ CfgHosts::getHostInternal(const SubnetID& subnet_id, const bool subnet6,
     }
     }
 
 
     if (host) {
     if (host) {
-        LOG_DEBUG(hosts_logger, HOSTS_DBG_TRACE_DETAIL_DATA,
+        LOG_DEBUG(hosts_logger, HOSTS_DBG_RESULTS,
                   HOSTS_CFG_GET_ONE_SUBNET_ID_HWADDR_DUID)
                   HOSTS_CFG_GET_ONE_SUBNET_ID_HWADDR_DUID)
             .arg(subnet_id)
             .arg(subnet_id)
             .arg(hwaddr ? hwaddr->toText() : "(no-hwaddr)")
             .arg(hwaddr ? hwaddr->toText() : "(no-hwaddr)")

+ 8 - 0
src/lib/dhcpsrv/hosts_messages.mes

@@ -93,6 +93,10 @@ arguments specify subnet id and IPv4 address respectively.
 This debug message logs the details of the host found using the
 This debug message logs the details of the host found using the
 subnet id and IPv4 address.
 subnet id and IPv4 address.
 
 
+% HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_NULL host not found using subnet id %1 and address %2
+This debug message is issued when no host was found for the specified
+subnet id and IPv4 address.
+
 % HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6 get one host with reservation for subnet id %1 and including IPv6 address %2
 % HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6 get one host with reservation for subnet id %1 and including IPv6 address %2
 This debug message is issued when retrieveing a host connected to the
 This debug message is issued when retrieveing a host connected to the
 specific subnet and having the specific IPv6 address reserved. The
 specific subnet and having the specific IPv6 address reserved. The
@@ -102,6 +106,10 @@ arguments specify subnet id and IPv6 address respectively.
 This debug message logs the details of the host found using the
 This debug message logs the details of the host found using the
 subnet id and IPv6 address.
 subnet id and IPv6 address.
 
 
+% HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_NULL host not found using subnet id %1 and address %2
+This debug message is issued when no host was found using the specified
+subnet if and IPv6 address.
+
 % HOSTS_CFG_GET_ONE_SUBNET_ID_HWADDR_DUID get one host with %1 reservation for subnet id %2, HWADDR %3, DUID %4
 % HOSTS_CFG_GET_ONE_SUBNET_ID_HWADDR_DUID get one host with %1 reservation for subnet id %2, HWADDR %3, DUID %4
 This debug message is issued when retrieving the host holding IPv4 or
 This debug message is issued when retrieving the host holding IPv4 or
 IPv6 reservations, which is connected to the specific subnet and is
 IPv6 reservations, which is connected to the specific subnet and is