3 * $Id: ACL.h,v 1.13 2005/05/06 01:57:55 hno 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
void aclDestroyAccessList(acl_access
**list
);
42 SQUIDCEXTERN
void aclDestroyAcls(ACL
**);
43 SQUIDCEXTERN
void aclDestroyAclList(acl_list
**);
44 SQUIDCEXTERN
void aclParseAccessLine(acl_access
**);
45 SQUIDCEXTERN
void aclParseAclList(acl_list
**);
46 SQUIDCEXTERN
int aclIsProxyAuth(const char *name
);
47 SQUIDCEXTERN err_type
aclGetDenyInfoPage(acl_deny_info_list
** head
, const char *name
);
49 SQUIDCEXTERN
void aclParseDenyInfoLine(struct _acl_deny_info_list
**);
51 SQUIDCEXTERN
void aclDestroyDenyInfoList(struct _acl_deny_info_list
**);
52 SQUIDCEXTERN wordlist
*aclDumpGeneric(const ACL
*);
53 SQUIDCEXTERN
void aclCacheMatchFlush(dlink_list
* cache
);
54 extern void dump_acl_access(StoreEntry
* entry
, const char *name
, acl_access
* head
);
55 int aclPurgeMethodInUse(acl_access
* a
);
56 extern const char *AclMatchedName
; /* NULL */
62 void *operator new(size_t);
63 void operator delete(void *);
65 static ACL
*Factory (char const *);
66 static void ParseAclLine(ACL
** head
);
67 static void Initialize();
68 static ACL
* FindByName(const char *name
);
72 virtual ACL
*clone()const = 0;
73 virtual void parse() = 0;
74 virtual char const *typeString() const = 0;
75 virtual bool isProxyAuth() const;
76 virtual bool requiresRequest() const;
77 virtual bool requiresReply() const;
78 virtual int match(ACLChecklist
* checklist
) = 0;
79 virtual wordlist
*dumpGeneric() const;
80 virtual wordlist
*dump() const = 0;
81 virtual bool empty () const = 0;
82 virtual bool valid () const;
83 int checklistMatches(ACLChecklist
*);
85 int cacheMatchAcl(dlink_list
* cache
, ACLChecklist
*);
86 virtual int matchForCache(ACLChecklist
*checklist
);
88 virtual void prepareForUse() {}
90 char name
[ACL_NAME_SZ
];
101 Prototype (ACL
const *, char const *);
103 static bool Registered(char const *);
104 static ACL
*Factory (char const *);
108 char const *typeString
;
111 static Vector
<Prototype
const *> * Registry
;
112 static void *Initialized
;
113 typedef Vector
<Prototype
const*>::iterator iterator
;
114 typedef Vector
<Prototype
const*>::const_iterator const_iterator
;
123 void *operator new(size_t);
124 void operator delete(void *);
125 bool containsPURGE() const;
132 CBDATA_CLASS(acl_access
);
139 MEMPROXY_CLASS(ACLList
);
142 void negated(bool isNegated
);
143 bool matches (ACLChecklist
*)const;
149 MEMPROXY_CLASS_INLINE(ACLList
)
151 typedef ACLList acl_list
;
152 #endif /* SQUID_ACL_H */