3 * $Id: ACL.h,v 1.4 2003/02/13 08:07:46 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 /* As ACL's get refactored, these probably need better homes */
46 void *operator new(size_t);
47 void operator delete(void *);
48 virtual void deleteSelf() const;
49 SplayNode
<char*> *values
;
57 SQUIDCEXTERN
int aclMatchAclList(const acl_list
* list
, ACLChecklist
* checklist
);
58 SQUIDCEXTERN
void aclDestroyAccessList(acl_access
**list
);
59 SQUIDCEXTERN
void aclDestroyAcls(acl
**);
60 SQUIDCEXTERN
void aclDestroyAclList(acl_list
**);
61 SQUIDCEXTERN
void aclParseAccessLine(acl_access
**);
62 SQUIDCEXTERN
void aclParseAclList(acl_list
**);
63 SQUIDCEXTERN
int aclIsProxyAuth(const char *name
);
64 SQUIDCEXTERN err_type
aclGetDenyInfoPage(acl_deny_info_list
** head
, const char *name
);
65 SQUIDCEXTERN
void aclParseDenyInfoLine(struct _acl_deny_info_list
**);
66 SQUIDCEXTERN
void aclDestroyDenyInfoList(struct _acl_deny_info_list
**);
67 SQUIDCEXTERN
void aclDestroyRegexList(struct _relist
*data
);
68 SQUIDCEXTERN
int aclMatchRegex(relist
* data
, const char *word
);
69 wordlist
*aclDumpRegexList(relist
* data
);
70 SQUIDCEXTERN
void aclParseRegexList(void *curlist
);
71 SQUIDCEXTERN wordlist
*aclDumpGeneric(const acl
*);
72 SQUIDCEXTERN
int aclPurgeMethodInUse(acl_access
*);
73 SQUIDCEXTERN
void aclCacheMatchFlush(dlink_list
* cache
);
74 extern void dump_acl_access(StoreEntry
* entry
, const char *name
, acl_access
* head
);
75 IPH aclLookupDstIPforASNDone
;
77 IDCB aclLookupIdentDone
;
79 FQDNH aclLookupSrcFQDNDone
;
80 FQDNH aclLookupDstFQDNDone
;
84 void *operator new(size_t);
85 void operator delete(void *);
86 virtual void deleteSelf() const;
88 static ACL
*Factory (char const *);
89 static void ParseAclLine(acl
** head
);
90 static ACL
* FindByName(const char *name
);
92 /* temporary until we subclass external acl's */
93 static void ExternalAclLookup(ACLChecklist
* ch
, ACL
*, EAH
* callback
, void *callback_data
);
96 ACL (squid_acl
const);
98 virtual ACL
*clone()const;
100 virtual char const *typeString() const;
101 virtual squid_acl
aclType() const { return type
;}
102 virtual bool isProxyAuth() const;
103 virtual bool requiresRequest() const;
104 virtual int match(ACLChecklist
* checklist
);
105 virtual wordlist
*dumpGeneric() const;
106 virtual wordlist
*dump() const;
107 virtual bool valid () const;
108 int checklistMatches(ACLChecklist
*);
110 /* only relevant to METHOD acl's */
111 virtual bool containsPURGE() const;
113 /* only relecant to ASN acl's */
116 int cacheMatchAcl(dlink_list
* cache
, ACLChecklist
*);
117 virtual int matchForCache(ACLChecklist
*checklist
);
119 char name
[ACL_NAME_SZ
];
123 static MemPool
*Pool
;
130 Prototype (ACL
const *, char const *);
132 static bool Registered(char const *);
133 static ACL
*Factory (char const *);
136 char const *typeString
;
138 static Vector
<Prototype
const *> * Registry
;
139 static void *Initialized
;
140 typedef Vector
<Prototype
const*>::iterator iterator
;
141 typedef Vector
<Prototype
const*>::const_iterator const_iterator
;
148 void *operator new(size_t);
149 void operator delete(void *);
150 virtual void deleteSelf() const;
151 bool containsPURGE() const;
157 CBDATA_CLASS(acl_access
);
162 void *operator new(size_t);
163 void operator delete(void *);
164 virtual void deleteSelf() const;
167 void negated(bool isNegated
);
168 bool matches (ACLChecklist
*)const;
173 static MemPool
*Pool
;
176 typedef ACLList acl_list
;
177 #endif /* SQUID_ACL_H */