2 * $Id: ACL.h,v 1.20 2008/02/26 21:49:34 amosjeffries Exp $
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
32 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
42 \todo FIXME: finish splitting out the dependencies here
43 * - typedefs should not be needed to parse this.
52 SQUIDCEXTERN
void aclDestroyAccessList(acl_access
**list
);
54 SQUIDCEXTERN
void aclDestroyAcls(ACL
**);
56 SQUIDCEXTERN
void aclDestroyAclList(ACLList
**);
58 SQUIDCEXTERN
void aclParseAccessLine(ConfigParser
&parser
, acl_access
**);
60 SQUIDCEXTERN
void aclParseAclList(ConfigParser
&parser
, ACLList
**);
62 SQUIDCEXTERN
int aclIsProxyAuth(const char *name
);
64 SQUIDCEXTERN err_type
aclGetDenyInfoPage(acl_deny_info_list
** head
, const char *name
, int redirect_allowed
);
67 SQUIDCEXTERN
void aclParseDenyInfoLine(struct acl_deny_info_list
**);
70 SQUIDCEXTERN
void aclDestroyDenyInfoList(struct acl_deny_info_list
**);
72 SQUIDCEXTERN wordlist
*aclDumpGeneric(const ACL
*);
74 SQUIDCEXTERN
void aclCacheMatchFlush(dlink_list
* cache
);
76 extern void dump_acl_access(StoreEntry
* entry
, const char *name
, acl_access
* head
);
78 int aclPurgeMethodInUse(acl_access
* a
);
80 extern const char *AclMatchedName
; /* NULL */
87 void *operator new(size_t);
88 void operator delete(void *);
90 static ACL
*Factory (char const *);
91 static void ParseAclLine(ConfigParser
&parser
, ACL
** head
);
92 static void Initialize();
93 static ACL
* FindByName(const char *name
);
97 virtual ACL
*clone()const = 0;
98 virtual void parse() = 0;
99 virtual char const *typeString() const = 0;
100 virtual bool isProxyAuth() const;
101 virtual bool requiresRequest() const;
102 virtual bool requiresReply() const;
103 virtual int match(ACLChecklist
* checklist
) = 0;
104 virtual wordlist
*dump() const = 0;
105 virtual bool empty () const = 0;
106 virtual bool valid () const;
107 int checklistMatches(ACLChecklist
*);
109 int cacheMatchAcl(dlink_list
* cache
, ACLChecklist
*);
110 virtual int matchForCache(ACLChecklist
*checklist
);
112 virtual void prepareForUse() {}
114 char name
[ACL_NAME_SZ
];
125 Prototype (ACL
const *, char const *);
127 static bool Registered(char const *);
128 static ACL
*Factory (char const *);
132 char const *typeString
;
135 static Vector
<Prototype
const *> * Registry
;
136 static void *Initialized
;
137 typedef Vector
<Prototype
const*>::iterator iterator
;
138 typedef Vector
<Prototype
const*>::const_iterator const_iterator
;
148 void *operator new(size_t);
149 void operator delete(void *);
150 bool containsPURGE() const;
157 CBDATA_CLASS(acl_access
);
165 MEMPROXY_CLASS(ACLList
);
168 void negated(bool isNegated
);
169 bool matches (ACLChecklist
*)const;
175 MEMPROXY_CLASS_INLINE(ACLList
);
178 class acl_proxy_auth_match_cache
182 MEMPROXY_CLASS(acl_proxy_auth_match_cache
);
188 MEMPROXY_CLASS_INLINE(acl_proxy_auth_match_cache
);
190 #endif /* SQUID_ACL_H */