]>
Commit | Line | Data |
---|---|---|
351fe86d AR |
1 | #ifndef SQUID_ACLFILLED_CHECKLIST_H |
2 | #define SQUID_ACLFILLED_CHECKLIST_H | |
3 | ||
4 | #include "acl/Checklist.h" | |
2f1431ea | 5 | #if USE_AUTH |
a33a428a | 6 | #include "auth/UserRequest.h" |
2f1431ea | 7 | #endif |
fb2178bb CT |
8 | #if USE_SSL |
9 | #include "ssl/support.h" | |
10 | #endif | |
351fe86d | 11 | |
a011edee | 12 | class CachePeer; |
351fe86d | 13 | class ConnStateData; |
a011edee | 14 | class ExternalACLEntry; |
582c2af2 | 15 | class HttpRequest; |
351fe86d AR |
16 | |
17 | /** \ingroup ACLAPI | |
18 | ACLChecklist filled with specific data, representing Squid and transaction | |
19 | state for access checks along with some data-specific checking methods */ | |
20 | class ACLFilledChecklist: public ACLChecklist | |
21 | { | |
22 | public: | |
23 | void *operator new(size_t); | |
24 | void operator delete(void *); | |
25 | ||
26 | ACLFilledChecklist(); | |
af6a12ee | 27 | ACLFilledChecklist(const acl_access *, HttpRequest *, const char *ident); |
351fe86d AR |
28 | ~ACLFilledChecklist(); |
29 | ||
30 | public: | |
31 | ConnStateData * conn() const; | |
32 | ||
33 | /// uses conn() if available | |
34 | int fd() const; | |
35 | ||
36 | /// set either conn | |
37 | void conn(ConnStateData *); | |
38 | /// set FD | |
39 | void fd(int aDescriptor); | |
40 | ||
41 | //int authenticated(); | |
42 | ||
43 | bool destinationDomainChecked() const; | |
44 | void markDestinationDomainChecked(); | |
45 | bool sourceDomainChecked() const; | |
46 | void markSourceDomainChecked(); | |
47 | ||
48 | // ACLChecklist API | |
49 | virtual bool hasRequest() const { return request != NULL; } | |
50 | virtual bool hasReply() const { return reply != NULL; } | |
51 | ||
52 | public: | |
b7ac5457 AJ |
53 | Ip::Address src_addr; |
54 | Ip::Address dst_addr; | |
55 | Ip::Address my_addr; | |
a3c6762c | 56 | CachePeer *dst_peer; |
12ef783b | 57 | char *dst_rdns; |
351fe86d AR |
58 | |
59 | HttpRequest *request; | |
60 | HttpReply *reply; | |
61 | ||
62 | char rfc931[USER_IDENT_SZ]; | |
2f1431ea | 63 | #if USE_AUTH |
c7baff40 | 64 | Auth::UserRequest::Pointer auth_user_request; |
2f1431ea | 65 | #endif |
351fe86d AR |
66 | #if SQUID_SNMP |
67 | char *snmp_community; | |
68 | #endif | |
69 | ||
70 | #if USE_SSL | |
23bb0ebf | 71 | /// SSL [certificate validation] errors, in undefined order |
7a957a93 | 72 | Ssl::Errors *sslErrors; |
351fe86d AR |
73 | #endif |
74 | ||
75 | ExternalACLEntry *extacl_entry; | |
76 | ||
351fe86d | 77 | private: |
351fe86d AR |
78 | ConnStateData * conn_; /**< hack for ident and NTLM */ |
79 | int fd_; /**< may be available when conn_ is not */ | |
80 | bool destinationDomainChecked_; | |
81 | bool sourceDomainChecked_; | |
351fe86d AR |
82 | /// not implemented; will cause link failures if used |
83 | ACLFilledChecklist(const ACLFilledChecklist &); | |
84 | /// not implemented; will cause link failures if used | |
85 | ACLFilledChecklist &operator=(const ACLFilledChecklist &); | |
c7bf588b FC |
86 | |
87 | CBDATA_CLASS(ACLFilledChecklist); | |
351fe86d AR |
88 | }; |
89 | ||
90 | /// convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*> | |
91 | inline | |
92 | ACLFilledChecklist *Filled(ACLChecklist *checklist) | |
93 | { | |
94 | // this should always be safe because ACLChecklist is an abstract class | |
95 | // and ACLFilledChecklist is its only [concrete] child | |
96 | return dynamic_cast<ACLFilledChecklist*>(checklist); | |
97 | } | |
98 | ||
99 | #endif /* SQUID_ACLFILLED_CHECKLIST_H */ |