]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ACL.h
Cleanup: zap CVS Id tags
[thirdparty/squid.git] / src / ACL.h
index 88fb50604552df2ea75f91969869144c65bf2aa2..918019521c20a78302c82e3d880e62b2d6067074 100644 (file)
--- a/src/ACL.h
+++ b/src/ACL.h
@@ -1,6 +1,5 @@
-
 /*
- * $Id: ACL.h,v 1.7 2003/02/21 22:50:04 robertc Exp $
+ * $Id$
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  *  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.
 
 #ifndef SQUID_ACL_H
 #define SQUID_ACL_H
+
 #include "Array.h"
+#include "cbdata.h"
+#include "dlink.h"
+/**
+ \todo FIXME: finish splitting out the dependencies here
+ *     - typedefs should not be needed to parse this.
+ */
+#include "typedefs.h"
+
+class ConfigParser;
 
 /* acl.c */
-SQUIDCEXTERN int aclMatchAclList(const acl_list * list, ACLChecklist * checklist);
+
+/// \ingroup ACLAPI
 SQUIDCEXTERN void aclDestroyAccessList(acl_access **list);
-SQUIDCEXTERN void aclDestroyAcls(acl **);
-SQUIDCEXTERN void aclDestroyAclList(acl_list **);
-SQUIDCEXTERN void aclParseAccessLine(acl_access **);
-SQUIDCEXTERN void aclParseAclList(acl_list **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclDestroyAcls(ACL **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclDestroyAclList(ACLList **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclParseAccessLine(ConfigParser &parser, acl_access **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclParseAclList(ConfigParser &parser, ACLList **);
+/// \ingroup ACLAPI
 SQUIDCEXTERN int aclIsProxyAuth(const char *name);
-SQUIDCEXTERN err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
+/// \ingroup ACLAPI
+SQUIDCEXTERN err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed);
 
-SQUIDCEXTERN void aclParseDenyInfoLine(struct _acl_deny_info_list **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclParseDenyInfoLine(struct acl_deny_info_list **);
 
-SQUIDCEXTERN void aclDestroyDenyInfoList(struct _acl_deny_info_list **);
-
-SQUIDCEXTERN void aclDestroyRegexList(struct _relist *data);
-SQUIDCEXTERN int aclMatchRegex(relist * data, const char *word);
-wordlist *aclDumpRegexList(relist * data);
-SQUIDCEXTERN void aclParseRegexList(void *curlist);
-SQUIDCEXTERN wordlist *aclDumpGeneric(const acl *);
-SQUIDCEXTERN int aclPurgeMethodInUse(acl_access *);
+/// \ingroup ACLAPI
+SQUIDCEXTERN void aclDestroyDenyInfoList(struct acl_deny_info_list **);
+/// \ingroup ACLAPI
+SQUIDCEXTERN wordlist *aclDumpGeneric(const ACL *);
+/// \ingroup ACLAPI
 SQUIDCEXTERN void aclCacheMatchFlush(dlink_list * cache);
+/// \ingroup ACLAPI
 extern void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
+/// \ingroup ACLAPI
+int aclPurgeMethodInUse(acl_access * a);
+/// \ingroup ACLAPI
+extern const char *AclMatchedName;     /* NULL */
 
+/// \ingroup ACLAPI
 class ACL
 {
 
 public:
     void *operator new(size_t);
     void operator delete(void *);
-    virtual void deleteSelf() const;
 
     static ACL *Factory (char const *);
-    static void ParseAclLine(acl ** head);
+    static void ParseAclLine(ConfigParser &parser, ACL ** head);
+    static void Initialize();
     static ACL* FindByName(const char *name);
 
-    /* temporary until we subclass external acl's */
-    static void ExternalAclLookup(ACLChecklist * ch, ACL *, EAH * callback, void *callback_data);
-
     ACL();
-    ACL (squid_acl const);
     virtual ~ACL();
-    virtual ACL *clone()const;
-    virtual void parse();
-    virtual char const *typeString() const;
-    virtual squid_acl aclType() const { return type;}
-
+    virtual ACL *clone()const = 0;
+    virtual void parse() = 0;
+    virtual char const *typeString() const = 0;
     virtual bool isProxyAuth() const;
     virtual bool requiresRequest() const;
-    virtual int match(ACLChecklist * checklist);
-    virtual wordlist *dumpGeneric() const;
-    virtual wordlist *dump() const;
+    virtual bool requiresReply() const;
+    virtual int match(ACLChecklist * checklist) = 0;
+    virtual wordlist *dump() const = 0;
+    virtual bool empty () const = 0;
     virtual bool valid () const;
     int checklistMatches(ACLChecklist *);
 
-    /* only relevant to METHOD acl's */
-    virtual bool containsPURGE() const;
-
-    /* only relecant to ASN acl's */
-    void startCache();
-
     int cacheMatchAcl(dlink_list * cache, ACLChecklist *);
     virtual int matchForCache(ACLChecklist *checklist);
 
+    virtual void prepareForUse() {}
+
     char name[ACL_NAME_SZ];
     char *cfgline;
     ACL *next;
 
-private:
-    static MemPool *Pool;
-    squid_acl type;
-
-protected:
-    void *data;
-
 public:
 
     class Prototype
@@ -136,16 +140,16 @@ public:
     };
 };
 
+/// \ingroup ACLAPI
 class acl_access
 {
 
 public:
     void *operator new(size_t);
     void operator delete(void *);
-    virtual void deleteSelf() const;
     bool containsPURGE() const;
     allow_t allow;
-    acl_list *aclList;
+    ACLList *aclList;
     char *cfgline;
     acl_access *next;
 
@@ -153,24 +157,34 @@ private:
     CBDATA_CLASS(acl_access);
 };
 
+/// \ingroup ACLAPI
 class ACLList
 {
 
 public:
-    void *operator new(size_t);
-    void operator delete(void *);
-    virtual void deleteSelf() const;
+    MEMPROXY_CLASS(ACLList);
 
     ACLList();
     void negated(bool isNegated);
     bool matches (ACLChecklist *)const;
     int op;
-    acl *_acl;
+    ACL *_acl;
     ACLList *next;
+};
 
-private:
-    static MemPool *Pool;
+MEMPROXY_CLASS_INLINE(ACLList);
+
+/// \ingroup ACLAPI
+class acl_proxy_auth_match_cache
+{
+
+public:
+    MEMPROXY_CLASS(acl_proxy_auth_match_cache);
+    dlink_node link;
+    int matchrv;
+    void *acl_data;
 };
 
-typedef ACLList acl_list;
+MEMPROXY_CLASS_INLINE(acl_proxy_auth_match_cache);
+
 #endif /* SQUID_ACL_H */