]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/FilledChecklist.h
Merge SBufList
[thirdparty/squid.git] / src / acl / FilledChecklist.h
1 #ifndef SQUID_ACLFILLED_CHECKLIST_H
2 #define SQUID_ACLFILLED_CHECKLIST_H
3
4 #include "AccessLogEntry.h"
5 #include "acl/Checklist.h"
6 #include "acl/forward.h"
7 #include "ip/Address.h"
8 #if USE_AUTH
9 #include "auth/UserRequest.h"
10 #endif
11 #if USE_SSL
12 #include "ssl/support.h"
13 #endif
14
15 class CachePeer;
16 class ConnStateData;
17 class ExternalACLEntry;
18 class HttpRequest;
19 class HttpReply;
20
21 /** \ingroup ACLAPI
22 ACLChecklist filled with specific data, representing Squid and transaction
23 state for access checks along with some data-specific checking methods */
24 class ACLFilledChecklist: public ACLChecklist
25 {
26 public:
27 ACLFilledChecklist();
28 ACLFilledChecklist(const acl_access *, HttpRequest *, const char *ident);
29 ~ACLFilledChecklist();
30
31 public:
32 /// The client connection manager
33 ConnStateData * conn() const;
34
35 /// The client side fd. It uses conn() if available
36 int fd() const;
37
38 /// set either conn
39 void conn(ConnStateData *);
40 /// set the client side FD
41 void fd(int aDescriptor);
42
43 //int authenticated();
44
45 bool destinationDomainChecked() const;
46 void markDestinationDomainChecked();
47 bool sourceDomainChecked() const;
48 void markSourceDomainChecked();
49
50 // ACLChecklist API
51 virtual bool hasRequest() const { return request != NULL; }
52 virtual bool hasReply() const { return reply != NULL; }
53
54 public:
55 Ip::Address src_addr;
56 Ip::Address dst_addr;
57 Ip::Address my_addr;
58 CachePeer *dst_peer;
59 char *dst_rdns;
60
61 HttpRequest *request;
62 HttpReply *reply;
63
64 char rfc931[USER_IDENT_SZ];
65 #if USE_AUTH
66 Auth::UserRequest::Pointer auth_user_request;
67 #endif
68 #if SQUID_SNMP
69 char *snmp_community;
70 #endif
71
72 #if USE_SSL
73 /// SSL [certificate validation] errors, in undefined order
74 Ssl::CertErrors *sslErrors;
75 /// The peer certificate
76 Ssl::X509_Pointer serverCert;
77 #endif
78
79 AccessLogEntry::Pointer al; ///< info for the future access.log entry
80
81 ExternalACLEntry *extacl_entry;
82
83 private:
84 ConnStateData * conn_; /**< hack for ident and NTLM */
85 int fd_; /**< may be available when conn_ is not */
86 bool destinationDomainChecked_;
87 bool sourceDomainChecked_;
88 /// not implemented; will cause link failures if used
89 ACLFilledChecklist(const ACLFilledChecklist &);
90 /// not implemented; will cause link failures if used
91 ACLFilledChecklist &operator=(const ACLFilledChecklist &);
92
93 CBDATA_CLASS2(ACLFilledChecklist);
94 };
95
96 /// convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
97 inline
98 ACLFilledChecklist *Filled(ACLChecklist *checklist)
99 {
100 // this should always be safe because ACLChecklist is an abstract class
101 // and ACLFilledChecklist is its only [concrete] child
102 return dynamic_cast<ACLFilledChecklist*>(checklist);
103 }
104
105 #endif /* SQUID_ACLFILLED_CHECKLIST_H */