From: Francesco Chemolli Date: Wed, 5 Sep 2012 19:54:09 +0000 (+0200) Subject: reamed acl_address to AclAddress and moved it to own file in acl/ X-Git-Tag: sourceformat-review-1~6^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0dc8ffa50cd1c9265e63afd10f4c17e8b9d9e767;p=thirdparty%2Fsquid.git reamed acl_address to AclAddress and moved it to own file in acl/ --- diff --git a/src/SquidConfig.h b/src/SquidConfig.h index 1983dcf3b2..d2daaf97a1 100644 --- a/src/SquidConfig.h +++ b/src/SquidConfig.h @@ -32,6 +32,7 @@ * */ +#include "acl/AclAddress.h" #include "ClientDelayConfig.h" #include "DelayConfig.h" #include "HttpHeaderTools.h" @@ -371,7 +372,7 @@ public: #endif acl_access *redirector; acl_access *reply; - acl_address *outgoing_address; + AclAddress *outgoing_address; #if USE_HTCP acl_access *htcp; diff --git a/src/acl/AclAddress.cc b/src/acl/AclAddress.cc new file mode 100644 index 0000000000..9818d689f1 --- /dev/null +++ b/src/acl/AclAddress.cc @@ -0,0 +1,32 @@ +/* + * 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. + */ + +#include "squid.h" +#include "AclAddress.h" + +//TODO: fill in diff --git a/src/acl/AclAddress.h b/src/acl/AclAddress.h new file mode 100644 index 0000000000..2f598b6b20 --- /dev/null +++ b/src/acl/AclAddress.h @@ -0,0 +1,42 @@ +#ifndef ACLADDRESS_H_ +#define ACLADDRESS_H_ +#include "Acl.h" +/* + * 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. + */ + +#include "ip/Address.h" +#include "acl/Acl.h" + +struct AclAddress { + AclAddress *next; + ACLList *aclList; + + Ip::Address addr; +}; + +#endif /* ACLADDRESS_H_ */ diff --git a/src/acl/Makefile.am b/src/acl/Makefile.am index 500018d89c..f9a4e54b76 100644 --- a/src/acl/Makefile.am +++ b/src/acl/Makefile.am @@ -19,7 +19,9 @@ libstate_la_SOURCES = \ Strategised.h \ \ FilledChecklist.cc \ - FilledChecklist.h + FilledChecklist.h \ + AclAddress.h \ + AclAddress.cc ## data-specific ACLs libacls_la_SOURCES = \ diff --git a/src/cache_cf.cc b/src/cache_cf.cc index c847a9c324..d2b9617394 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -32,6 +32,7 @@ #include "squid.h" #include "acl/Acl.h" +#include "acl/AclAddress.h" #include "acl/AclDenyInfoList.h" #include "acl/AclNameList.h" #include "acl/Gadgets.h" @@ -1364,13 +1365,13 @@ free_address(Ip::Address *addr) addr->SetEmpty(); } -CBDATA_TYPE(acl_address); +CBDATA_TYPE(AclAddress); static void -dump_acl_address(StoreEntry * entry, const char *name, acl_address * head) +dump_acl_address(StoreEntry * entry, const char *name, AclAddress * head) { char buf[MAX_IPSTRLEN]; - acl_address *l; + AclAddress *l; for (l = head; l; l = l->next) { if (!l->addr.IsAnyAddr()) @@ -1387,17 +1388,17 @@ dump_acl_address(StoreEntry * entry, const char *name, acl_address * head) static void freed_acl_address(void *data) { - acl_address *l = static_cast(data); + AclAddress *l = static_cast(data); aclDestroyAclList(&l->aclList); } static void -parse_acl_address(acl_address ** head) +parse_acl_address(AclAddress ** head) { - acl_address *l; - acl_address **tail = head; /* sane name below */ - CBDATA_INIT_TYPE_FREECB(acl_address, freed_acl_address); - l = cbdataAlloc(acl_address); + AclAddress *l; + AclAddress **tail = head; /* sane name below */ + CBDATA_INIT_TYPE_FREECB(AclAddress, freed_acl_address); + l = cbdataAlloc(AclAddress); parse_address(&l->addr); aclParseAclList(LegacyParser, &l->aclList); @@ -1408,10 +1409,10 @@ parse_acl_address(acl_address ** head) } static void -free_acl_address(acl_address ** head) +free_acl_address(AclAddress ** head) { while (*head) { - acl_address *l = *head; + AclAddress *l = *head; *head = l->next; cbdataFree(l); } diff --git a/src/forward.cc b/src/forward.cc index 471f5be26c..f8b1a42b30 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -32,6 +32,7 @@ #include "squid.h" #include "AccessLogEntry.h" +#include "acl/AclAddress.h" #include "acl/FilledChecklist.h" #include "acl/Gadgets.h" #include "anyp/PortCfg.h" @@ -1423,7 +1424,7 @@ getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn) // TODO use the connection details in ACL. // needs a bit of rework in ACLFilledChecklist to use Comm::Connection instead of ConnStateData - acl_address *l; + AclAddress *l; for (l = Config.accessList.outgoing_address; l; l = l->next) { /* check if the outgoing address is usable to the destination */ diff --git a/src/structs.h b/src/structs.h index 2d59eb2a39..127448988e 100644 --- a/src/structs.h +++ b/src/structs.h @@ -68,13 +68,6 @@ public: class ACLList; -struct acl_address { - acl_address *next; - ACLList *aclList; - - Ip::Address addr; -}; - struct acl_tos { acl_tos *next; ACLList *aclList;