]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/AclDenyInfoList.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / acl / AclDenyInfoList.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_ACLDENYINFOLIST_H_
10 #define SQUID_ACLDENYINFOLIST_H_
11
12 #include "acl/forward.h"
13 #include "err_type.h"
14 #include "errorpage.h"
15 #include "mem/forward.h"
16 #include "sbuf/forward.h"
17
18 /// deny_info representation. Currently a POD.
19 class AclDenyInfoList
20 {
21 MEMPROXY_CLASS(AclDenyInfoList);
22
23 public:
24 AclDenyInfoList(const char *t, const SBuf &aCfgLocation) {
25 err_page_name = xstrdup(t);
26 err_page_id = errorReservePageId(t, aCfgLocation);
27 }
28 ~AclDenyInfoList() {
29 xfree(err_page_name);
30 while (next) {
31 auto *a = next;
32 next = a->next;
33 a->next = nullptr;
34 delete a;
35 }
36 }
37 err_type err_page_id = ERR_NONE;
38 char *err_page_name = nullptr;
39 SBufList acl_list; ///< ACL names in configured order
40 AclDenyInfoList *next = nullptr;
41 };
42
43 #endif /* SQUID_ACLDENYINFOLIST_H_ */
44