]>
Commit | Line | Data |
---|---|---|
225b7b10 | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
225b7b10 | 3 | * |
bbc27441 AJ |
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. | |
225b7b10 | 7 | */ |
bbc27441 | 8 | |
225b7b10 | 9 | #ifndef SQUID_EXTERNALACL_H |
10 | #define SQUID_EXTERNALACL_H | |
e1f7507e | 11 | |
3ad63615 | 12 | #include "acl/Checklist.h" |
abdd93d0 AJ |
13 | #include "base/RefCount.h" |
14 | ||
613924ee | 15 | class external_acl; |
f963b531 | 16 | class external_acl_data; |
314782d4 | 17 | class StoreEntry; |
613924ee | 18 | |
62e76326 | 19 | class ExternalACLLookup : public ACLChecklist::AsyncState |
20 | { | |
21 | ||
22 | public: | |
225b7b10 | 23 | static ExternalACLLookup *Instance(); |
24 | virtual void checkForAsync(ACLChecklist *)const; | |
62e76326 | 25 | |
e0f7153c AR |
26 | // If possible, starts an asynchronous lookup of an external ACL. |
27 | // Otherwise, asserts (or bails if background refresh is requested). | |
28 | static void Start(ACLChecklist *checklist, external_acl_data *acl, bool bg); | |
29 | ||
62e76326 | 30 | private: |
225b7b10 | 31 | static ExternalACLLookup instance_; |
abdd93d0 | 32 | static void LookupDone(void *data, const ExternalACLEntryPointer &result); |
225b7b10 | 33 | }; |
62e76326 | 34 | |
3ad63615 | 35 | #include "acl/Acl.h" |
e1f7507e | 36 | |
b0dd28ba | 37 | class ACLExternal : public ACL |
38 | { | |
b001e822 | 39 | MEMPROXY_CLASS(ACLExternal); |
b0dd28ba | 40 | |
741c2986 | 41 | public: |
e0f7153c | 42 | static void ExternalAclLookup(ACLChecklist * ch, ACLExternal *); |
b0dd28ba | 43 | |
b0dd28ba | 44 | ACLExternal(char const *); |
45 | ACLExternal(ACLExternal const &); | |
46 | ~ACLExternal(); | |
47 | ACLExternal&operator=(ACLExternal const &); | |
48 | ||
49 | virtual ACL *clone()const; | |
50 | virtual char const *typeString() const; | |
51 | virtual void parse(); | |
52 | virtual int match(ACLChecklist *checklist); | |
53 | /* This really should be dynamic based on the external class defn */ | |
4ff6370b | 54 | virtual bool requiresAle() const {return true;} |
b0dd28ba | 55 | virtual bool requiresRequest() const {return true;} |
56 | ||
57 | /* when requiresRequest is made dynamic, review this too */ | |
58 | // virtual bool requiresReply() const {return true;} | |
e870b1f8 | 59 | virtual bool isProxyAuth() const; |
dfad5100 | 60 | virtual SBufList dump() const; |
b0dd28ba | 61 | virtual bool valid () const; |
4b0f5de8 | 62 | virtual bool empty () const; |
b0dd28ba | 63 | |
64 | protected: | |
b0dd28ba | 65 | static Prototype RegistryProtoype; |
66 | static ACLExternal RegistryEntry_; | |
67 | external_acl_data *data; | |
68 | char const *class_; | |
69 | }; | |
70 | ||
314782d4 FC |
71 | void parse_externalAclHelper(external_acl **); |
72 | void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *); | |
73 | void free_externalAclHelper(external_acl **); | |
abdd93d0 | 74 | typedef void EAH(void *data, const ExternalACLEntryPointer &result); |
314782d4 FC |
75 | void externalAclLookup(ACLChecklist * ch, void *acl_data, EAH * handler, void *data); |
76 | void externalAclInit(void); | |
77 | void externalAclShutdown(void); | |
fc54b8d2 | 78 | |
225b7b10 | 79 | #endif /* SQUID_EXTERNALACL_H */ |
f53969cc | 80 |