]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/fqdncache.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / fqdncache.cc
index e251f3e90e6d46911e581b174bc7040056715757..3daff6082829c2a104d36a6d0c1896114f4a1aef 100644 (file)
@@ -1,48 +1,25 @@
 /*
- * DEBUG: section 35    FQDN Cache
- * AUTHOR: Harvest Derived
- *
- * SQUID Web Proxy Cache          http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- *  Squid is the result of efforts by numerous individuals from
- *  the Internet community; see the CONTRIBUTORS file for full
- *  details.   Many organizations have provided support for Squid's
- *  development; see the SPONSORS file for full details.  Squid is
- *  Copyrighted (C) 2001 by the Regents of the University of
- *  California; see the COPYRIGHT file for full details.  Squid
- *  incorporates software developed and/or copyrighted by other
- *  sources; see the CREDITS file for full details.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
  *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
+/* DEBUG: section 35    FQDN Cache */
+
 #include "squid.h"
 #include "cbdata.h"
 #include "DnsLookupDetails.h"
 #include "event.h"
 #include "helper.h"
-#include "HelperReply.h"
-#include "Mem.h"
 #include "mgr/Registration.h"
 #include "SquidConfig.h"
 #include "SquidDns.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "Store.h"
+#include "util.h"
 #include "wordlist.h"
 
 #if SQUID_SNMP
 class fqdncache_entry
 {
 public:
-    hash_link hash;            /* must be first */
+    hash_link hash;     /* must be first */
     time_t lastref;
     time_t expires;
     unsigned char name_count;
@@ -191,7 +168,7 @@ fqdncacheRelease(fqdncache_entry * f)
 
 /**
  \ingroup FQDNCacheInternal
- \param name   FQDN hash string.
+ \param name    FQDN hash string.
  \retval Match for given name
  */
 static fqdncache_entry *
@@ -226,7 +203,7 @@ fqdncacheExpiredEntry(const fqdncache_entry * f)
 
 /// \ingroup FQDNCacheAPI
 void
-fqdncache_purgelru(void *notused)
+fqdncache_purgelru(void *)
 {
     dlink_node *m;
     dlink_node *prev = NULL;
@@ -262,8 +239,8 @@ purge_entries_fromhosts(void)
     fqdncache_entry *t;
 
     while (m) {
-        if (i != NULL) {       /* need to delay deletion */
-            fqdncacheRelease(i);       /* we just override locks */
+        if (i != NULL) {    /* need to delay deletion */
+            fqdncacheRelease(i);    /* we just override locks */
             i = NULL;
         }
 
@@ -431,12 +408,12 @@ fqdncacheHandleReply(void *data, const rfc1035_rr * answers, int na, const char
 /**
  \ingroup FQDNCacheAPI
  *
- \param addr           IP address of domain to resolve.
- \param handler                A pointer to the function to be called when
- *                     the reply from the FQDN cache
- *                     (or the DNS if the FQDN cache misses)
- \param handlerData    Information that is passed to the handler
- *                     and does not affect the FQDN cache.
+ \param addr        IP address of domain to resolve.
+ \param handler     A pointer to the function to be called when
+ *          the reply from the FQDN cache
+ *          (or the DNS if the FQDN cache misses)
+ \param handlerData Information that is passed to the handler
+ *          and does not affect the FQDN cache.
  */
 void
 fqdncache_nbgethostbyaddr(const Ip::Address &addr, FQDNH * handler, void *handlerData)
@@ -501,8 +478,8 @@ fqdncache_nbgethostbyaddr(const Ip::Address &addr, FQDNH * handler, void *handle
  * DNS, unless this is requested, by setting the flags
  * to FQDN_LOOKUP_IF_MISS.
  *
- \param addr   address of the FQDN being resolved
- \param flags  values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
+ \param addr    address of the FQDN being resolved
+ \param flags   values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
  *
  */
 const char *
@@ -676,8 +653,8 @@ fqdncache_restart(void)
  * The worldist is to be managed by the caller,
  * including pointed-to strings
  *
- \param addr           FQDN name to be added.
- \param hostnames      ??
+ \param addr        FQDN name to be added.
+ \param hostnames   ??
  */
 void
 fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames)
@@ -709,7 +686,7 @@ fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames)
     }
 
     fce->name_count = j;
-    fce->names[j] = NULL;      /* it's safe */
+    fce->names[j] = NULL;   /* it's safe */
     fce->flags.fromhosts = true;
     fqdncacheAddEntry(fce);
     fqdncacheLockEntry(fce);
@@ -827,3 +804,4 @@ snmp_netFqdnFn(variable_list * Var, snint * ErrP)
 }
 
 #endif /*SQUID_SNMP */
+