FilledChecklist.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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_SRC_ACL_FILLEDCHECKLIST_H
10 #define SQUID_SRC_ACL_FILLEDCHECKLIST_H
11 
12 #include "AccessLogEntry.h"
13 #include "acl/Acl.h"
14 #include "acl/Checklist.h"
15 #include "acl/forward.h"
16 #include "base/CbcPointer.h"
17 #include "error/forward.h"
18 #include "HttpReply.h"
19 #include "HttpRequest.h"
20 #include "ip/Address.h"
21 #if USE_AUTH
22 #include "auth/UserRequest.h"
23 #endif
24 #include "security/CertError.h"
25 
26 class CachePeer;
27 class ConnStateData;
28 
34 {
36 
37 public:
41  using MakingPointer = std::unique_ptr<ACLFilledChecklist>;
42 
45  ~ACLFilledChecklist() override;
46 
49  static MakingPointer Make(const acl_access *a, HttpRequest *r) { return MakingPointer(new ACLFilledChecklist(a, r)); }
50 
54  static void NonBlockingCheck(MakingPointer &&p, ACLCB *cb, void *data) { p->nonBlockingCheck(cb, data); (void)p.release(); }
55 
57  void setRequest(HttpRequest *);
58 
62  void updateAle(const AccessLogEntry::Pointer &);
63 
64 public:
66  ConnStateData * conn() const;
67 
69  int fd() const;
70 
72  void setConn(ConnStateData *);
74  void fd(int aDescriptor);
75 
78  const HttpReply &reply() const { return *reply_; }
79 
82  void updateReply(const HttpReply::Pointer &);
83 
84  bool destinationDomainChecked() const;
86  bool sourceDomainChecked() const;
88 
89  // ACLChecklist API
90  bool hasRequest() const override { return request != nullptr; }
91  bool hasReply() const override { return reply_ != nullptr; }
92  bool hasAle() const override { return al != nullptr; }
93  void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override;
94  void verifyAle() const override;
95 
96 public:
101  char *dst_rdns;
102 
104 
105 #if USE_AUTH
107 #endif
108 #if SQUID_SNMP
110 #endif
111 
112  // TODO: RefCount errors; do not ignore them because their "owner" is gone!
118 
123 
125 
127 
129 
130 private:
132  int fd_;
135 
142 };
143 
145 inline
147 {
148  // this should always be safe because ACLChecklist is an abstract class
149  // and ACLFilledChecklist is its only [concrete] child
150  return dynamic_cast<ACLFilledChecklist*>(checklist);
151 }
152 
153 #endif /* SQUID_SRC_ACL_FILLEDCHECKLIST_H */
154 
Ip::Address dst_addr
ExternalACLEntryPointer extacl_entry
bool hasRequest() const override
Ip::Address src_addr
std::unique_ptr< ACLFilledChecklist > MakingPointer
const HttpReply & reply() const
Definition: SBuf.h:93
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
bool destinationDomainChecked() const
err_type
Definition: forward.h:14
CbcPointer< Security::CertErrors > sslErrors
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
void updateReply(const HttpReply::Pointer &)
void ACLCB(Acl::Answer, void *)
ACL checklist callback.
Definition: Checklist.h:23
ConnStateData * conn() const
The client connection manager.
HttpReply::Pointer reply_
response added by updateReply() or nil
static MakingPointer Make(const acl_access *a, HttpRequest *r)
Security::CertPointer serverCert
bool hasAle() const override
int fd() const
The client side fd. It uses conn() if available.
void verifyAle() const override
warns if there are uninitialized ALE components and fills them
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
HttpRequest::Pointer request
static void NonBlockingCheck(MakingPointer &&p, ACLCB *cb, void *data)
bool hasReply() const override
ACLFilledChecklist & operator=(const ACLFilledChecklist &)
not implemented; will cause link failures if used
ConnStateData * conn_
hack: client-to-Squid connection manager (if any)
void setConn(ConnStateData *)
set either conn
void setRequest(HttpRequest *)
configure client request-related fields for the first time
~ACLFilledChecklist() override
void markDestinationDomainChecked()
Auth::UserRequest::Pointer auth_user_request
void updateAle(const AccessLogEntry::Pointer &)
bool sourceDomainChecked() const
CBDATA_CLASS_WITH_MAKE(ACLFilledChecklist)

 

Introduction

Documentation

Support

Miscellaneous