]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/FilledChecklist.h
SourceLayout: Add Ip namespace for internal libip
[thirdparty/squid.git] / src / acl / FilledChecklist.h
CommitLineData
351fe86d
AR
1#ifndef SQUID_ACLFILLED_CHECKLIST_H
2#define SQUID_ACLFILLED_CHECKLIST_H
3
4#include "acl/Checklist.h"
5
6class AuthUserRequest;
7class ExternalACLEntry;
8class ConnStateData;
9
10/** \ingroup ACLAPI
11 ACLChecklist filled with specific data, representing Squid and transaction
12 state for access checks along with some data-specific checking methods */
13class ACLFilledChecklist: public ACLChecklist
14{
15public:
16 void *operator new(size_t);
17 void operator delete(void *);
18
19 ACLFilledChecklist();
af6a12ee 20 ACLFilledChecklist(const acl_access *, HttpRequest *, const char *ident);
351fe86d
AR
21 ~ACLFilledChecklist();
22
23public:
24 ConnStateData * conn() const;
25
26 /// uses conn() if available
27 int fd() const;
28
29 /// set either conn
30 void conn(ConnStateData *);
31 /// set FD
32 void fd(int aDescriptor);
33
34 //int authenticated();
35
36 bool destinationDomainChecked() const;
37 void markDestinationDomainChecked();
38 bool sourceDomainChecked() const;
39 void markSourceDomainChecked();
40
41 // ACLChecklist API
42 virtual bool hasRequest() const { return request != NULL; }
43 virtual bool hasReply() const { return reply != NULL; }
44
45public:
b7ac5457
AJ
46 Ip::Address src_addr;
47 Ip::Address dst_addr;
48 Ip::Address my_addr;
351fe86d 49 struct peer *dst_peer;
12ef783b 50 char *dst_rdns;
351fe86d
AR
51
52 HttpRequest *request;
53 HttpReply *reply;
54
55 char rfc931[USER_IDENT_SZ];
56 AuthUserRequest *auth_user_request;
57
58#if SQUID_SNMP
59 char *snmp_community;
60#endif
61
62#if USE_SSL
63 int ssl_error;
64#endif
65
66 ExternalACLEntry *extacl_entry;
67
68private:
69 virtual void checkCallback(allow_t answer);
70
71private:
72 CBDATA_CLASS(ACLFilledChecklist);
73
74 ConnStateData * conn_; /**< hack for ident and NTLM */
75 int fd_; /**< may be available when conn_ is not */
76 bool destinationDomainChecked_;
77 bool sourceDomainChecked_;
78
79private:
80 /// not implemented; will cause link failures if used
81 ACLFilledChecklist(const ACLFilledChecklist &);
82 /// not implemented; will cause link failures if used
83 ACLFilledChecklist &operator=(const ACLFilledChecklist &);
84};
85
86/// convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
87inline
88ACLFilledChecklist *Filled(ACLChecklist *checklist)
89{
90 // this should always be safe because ACLChecklist is an abstract class
91 // and ACLFilledChecklist is its only [concrete] child
92 return dynamic_cast<ACLFilledChecklist*>(checklist);
93}
94
95#endif /* SQUID_ACLFILLED_CHECKLIST_H */