]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Gadgets.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / acl / Gadgets.h
1 /*
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_ACL_GADGETS_H
10 #define SQUID_ACL_GADGETS_H
11
12 #include "acl/forward.h"
13 #include "err_type.h"
14
15 #include <sstream>
16
17 class ConfigParser;
18 class dlink_list;
19 class StoreEntry;
20 class wordlist;
21
22 /// Register an ACL object for future deletion. Repeated registrations are OK.
23 /// \ingroup ACLAPI
24 void aclRegister(ACL *acl);
25 /// \ingroup ACLAPI
26 void aclDestroyAccessList(acl_access **list);
27 /// \ingroup ACLAPI
28 void aclDestroyAcls(ACL **);
29 /// \ingroup ACLAPI
30 void aclDestroyAclList(ACLList **);
31 /// Parses a single line of a "action followed by acls" directive (e.g., http_access).
32 /// \ingroup ACLAPI
33 void aclParseAccessLine(const char *directive, ConfigParser &parser, Acl::Tree **);
34 /// Parses a single line of a "some context followed by acls" directive (e.g., note n v).
35 /// The label parameter identifies the context (for debugging).
36 /// \ingroup ACLAPI
37 void aclParseAclList(ConfigParser &parser, Acl::Tree **, const char *label);
38 /// Template to convert various context lables to strings. \ingroup ACLAPI
39 template <class Any>
40 inline
41 void aclParseAclList(ConfigParser &parser, Acl::Tree **tree, const Any any)
42 {
43 std::ostringstream buf;
44 buf << any;
45 aclParseAclList(parser, tree, buf.str().c_str());
46 }
47
48 /// \ingroup ACLAPI
49 int aclIsProxyAuth(const char *name);
50 /// \ingroup ACLAPI
51 err_type aclGetDenyInfoPage(AclDenyInfoList ** head, const char *name, int redirect_allowed);
52 /// \ingroup ACLAPI
53 void aclParseDenyInfoLine(AclDenyInfoList **);
54 /// \ingroup ACLAPI
55 void aclDestroyDenyInfoList(AclDenyInfoList **);
56 /// \ingroup ACLAPI
57 wordlist *aclDumpGeneric(const ACL *);
58 /// \ingroup ACLAPI
59 void aclCacheMatchFlush(dlink_list * cache);
60 /// \ingroup ACLAPI
61 void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
62 /// \ingroup ACLAPI
63 void dump_acl_list(StoreEntry * entry, ACLList * head);
64
65 #endif /* SQUID_ACL_GADGETS_H */
66