]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/Asn.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / Asn.cc
index fad7d5e727230561b4ea7f4add6655c1b87c3ba6..1adb07f360fadc6c9b2a6a672696391df1f69cd6 100644 (file)
@@ -1,36 +1,13 @@
-
 /*
- * DEBUG: section 53    AS Number handling
- * AUTHOR: Duane Wessels, Kostas Anagnostakis
- *
- * 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 53    AS Number handling */
+
 #include "squid.h"
 #include "acl/Acl.h"
 #include "acl/Asn.h"
@@ -52,7 +29,7 @@
 #include "StoreClient.h"
 
 #define WHOIS_PORT 43
-#define        AS_REQBUF_SZ    4096
+#define AS_REQBUF_SZ    4096
 
 /* BEGIN of definitions for radix tree entries */
 
@@ -85,11 +62,13 @@ template cbdata_type CbDataList<int>::CBDATA_CbDataList;
  */
 struct as_info {
     CbDataList<int> *as_number;
-    time_t expires;            /* NOTUSED */
+    time_t expires;     /* NOTUSED */
 };
 
 class ASState
 {
+    CBDATA_CLASS(ASState);
+
 public:
     ASState();
     ~ASState();
@@ -102,20 +81,18 @@ public:
     int reqofs;
     char reqbuf[AS_REQBUF_SZ];
     bool dataRead;
-private:
-    CBDATA_CLASS2(ASState);
 };
 
 CBDATA_CLASS_INIT(ASState);
 
 ASState::ASState() :
-        entry(NULL),
-        sc(NULL),
-        request(NULL),
-        as_number(0),
-        offset(0),
-        reqofs(0),
-        dataRead(false)
+    entry(NULL),
+    sc(NULL),
+    request(NULL),
+    as_number(0),
+    offset(0),
+    reqofs(0),
+    dataRead(false)
 {
     memset(reqbuf, 0, AS_REQBUF_SZ);
 }
@@ -145,8 +122,8 @@ static STCB asHandleReply;
 extern "C" {
 #endif
 
-    static int destroyRadixNode(struct squid_radix_node *rn, void *w);
-    static int printRadixNode(struct squid_radix_node *rn, void *sentry);
+static int destroyRadixNode(struct squid_radix_node *rn, void *w);
+static int printRadixNode(struct squid_radix_node *rn, void *sentry);
 
 #if defined(__cplusplus)
 }
@@ -220,7 +197,7 @@ asnRegisterWithCacheManager(void)
 
 /* initialize the radix tree structure */
 
-SQUIDCEXTERN int squid_max_keylen;     /* yuck.. this is in lib/radix.c */
+SQUIDCEXTERN int squid_max_keylen;  /* yuck.. this is in lib/radix.c */
 
 void
 asnInit(void)
@@ -462,7 +439,7 @@ asnAddNet(char *as_string, int as_number)
         e->e_info = asinfo;
     }
 
-    if (rn == 0) {             /* assert might expand to nothing */
+    if (rn == 0) {      /* assert might expand to nothing */
         xfree(asinfo);
         delete q;
         xfree(e);
@@ -656,3 +633,4 @@ ACLDestinationASNStrategy::Instance()
 }
 
 ACLDestinationASNStrategy ACLDestinationASNStrategy::Instance_;
+