3 * $Id: ACL.h,v 1.7 2003/02/21 22:50:04 robertc Exp $
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
33 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
41 SQUIDCEXTERN
int aclMatchAclList(const acl_list
* list
, ACLChecklist
* checklist
);
42 SQUIDCEXTERN
void aclDestroyAccessList(acl_access
**list
);
43 SQUIDCEXTERN
void aclDestroyAcls(acl
**);
44 SQUIDCEXTERN
void aclDestroyAclList(acl_list
**);
45 SQUIDCEXTERN
void aclParseAccessLine(acl_access
**);
46 SQUIDCEXTERN
void aclParseAclList(acl_list
**);
47 SQUIDCEXTERN
int aclIsProxyAuth(const char *name
);
48 SQUIDCEXTERN err_type
aclGetDenyInfoPage(acl_deny_info_list
** head
, const char *name
);
50 SQUIDCEXTERN
void aclParseDenyInfoLine(struct _acl_deny_info_list
**);
52 SQUIDCEXTERN
void aclDestroyDenyInfoList(struct _acl_deny_info_list
**);
54 SQUIDCEXTERN
void aclDestroyRegexList(struct _relist
*data
);
55 SQUIDCEXTERN
int aclMatchRegex(relist
* data
, const char *word
);
56 wordlist
*aclDumpRegexList(relist
* data
);
57 SQUIDCEXTERN
void aclParseRegexList(void *curlist
);
58 SQUIDCEXTERN wordlist
*aclDumpGeneric(const acl
*);
59 SQUIDCEXTERN
int aclPurgeMethodInUse(acl_access
*);
60 SQUIDCEXTERN
void aclCacheMatchFlush(dlink_list
* cache
);
61 extern void dump_acl_access(StoreEntry
* entry
, const char *name
, acl_access
* head
);
67 void *operator new(size_t);
68 void operator delete(void *);
69 virtual void deleteSelf() const;
71 static ACL
*Factory (char const *);
72 static void ParseAclLine(acl
** head
);
73 static ACL
* FindByName(const char *name
);
75 /* temporary until we subclass external acl's */
76 static void ExternalAclLookup(ACLChecklist
* ch
, ACL
*, EAH
* callback
, void *callback_data
);
79 ACL (squid_acl
const);
81 virtual ACL
*clone()const;
83 virtual char const *typeString() const;
84 virtual squid_acl
aclType() const { return type
;}
86 virtual bool isProxyAuth() const;
87 virtual bool requiresRequest() const;
88 virtual int match(ACLChecklist
* checklist
);
89 virtual wordlist
*dumpGeneric() const;
90 virtual wordlist
*dump() const;
91 virtual bool valid () const;
92 int checklistMatches(ACLChecklist
*);
94 /* only relevant to METHOD acl's */
95 virtual bool containsPURGE() const;
97 /* only relecant to ASN acl's */
100 int cacheMatchAcl(dlink_list
* cache
, ACLChecklist
*);
101 virtual int matchForCache(ACLChecklist
*checklist
);
103 char name
[ACL_NAME_SZ
];
108 static MemPool
*Pool
;
121 Prototype (ACL
const *, char const *);
123 static bool Registered(char const *);
124 static ACL
*Factory (char const *);
128 char const *typeString
;
131 static Vector
<Prototype
const *> * Registry
;
132 static void *Initialized
;
133 typedef Vector
<Prototype
const*>::iterator iterator
;
134 typedef Vector
<Prototype
const*>::const_iterator const_iterator
;
143 void *operator new(size_t);
144 void operator delete(void *);
145 virtual void deleteSelf() const;
146 bool containsPURGE() const;
153 CBDATA_CLASS(acl_access
);
160 void *operator new(size_t);
161 void operator delete(void *);
162 virtual void deleteSelf() const;
165 void negated(bool isNegated
);
166 bool matches (ACLChecklist
*)const;
172 static MemPool
*Pool
;
175 typedef ACLList acl_list
;
176 #endif /* SQUID_ACL_H */