3 * $Id: ACL.h,v 1.3 2003/02/12 06:10:58 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 SQUIDCEXTERN
void aclParseRegexList(void *curlist
);
70 SQUIDCEXTERN wordlist
*aclDumpGeneric(const acl
*);
71 SQUIDCEXTERN
int aclPurgeMethodInUse(acl_access
*);
72 SQUIDCEXTERN
void aclCacheMatchFlush(dlink_list
* cache
);
73 SQUIDCEXTERN
int aclAuthenticated(ACLChecklist
* checklist
);
74 void dump_acl_access(StoreEntry
* entry
, const char *name
, acl_access
* head
);
78 void *operator new(size_t);
79 void operator delete(void *);
80 virtual void deleteSelf() const;
82 static ACL
*Factory (char const *);
83 static void ParseAclLine(acl
** head
);
86 ACL (squid_acl
const);
88 virtual ACL
*clone()const;
90 virtual char const *typeString() const;
91 virtual squid_acl
aclType() const { return type
;}
92 virtual bool isProxyAuth() const;
93 virtual bool requiresRequest() const;
94 virtual int match(ACLChecklist
* checklist
);
95 virtual wordlist
*dumpGeneric() const;
96 virtual wordlist
*dump() const;
97 virtual bool valid () const;
98 virtual void startExternal(ACLChecklist
*);
99 int checklistMatches(ACLChecklist
*);
101 /* only relevant to METHOD acl's */
102 virtual bool containsPURGE() const;
104 /* only relecant to ASN acl's */
108 char name
[ACL_NAME_SZ
];
112 static MemPool
*Pool
;
119 Prototype (ACL
const *, char const *);
121 static bool Registered(char const *);
122 static ACL
*Factory (char const *);
125 char const *typeString
;
127 static Vector
<Prototype
const *> * Registry
;
128 static void *Initialized
;
129 typedef Vector
<Prototype
const*>::iterator iterator
;
130 typedef Vector
<Prototype
const*>::const_iterator const_iterator
;
137 void *operator new(size_t);
138 void operator delete(void *);
139 virtual void deleteSelf() const;
140 bool containsPURGE() const;
146 CBDATA_CLASS(acl_access
);
151 void *operator new(size_t);
152 void operator delete(void *);
153 virtual void deleteSelf() const;
156 void negated(bool isNegated
);
157 bool matches (ACLChecklist
*)const;
162 static MemPool
*Pool
;
165 typedef ACLList acl_list
;
166 #endif /* SQUID_ACL_H */