Squid Web Cache master
Loading...
Searching...
No Matches
FilledChecklist.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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
26class CachePeer;
27class ConnStateData;
28
34{
36
37public:
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
63
64public:
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
96public:
101 char *dst_rdns = nullptr;
102
104
105#if USE_AUTH
107#endif
108#if SQUID_SNMP
109 char *snmp_community = nullptr;
110#endif
111
112 // TODO: RefCount errors; do not ignore them because their "owner" is gone!
118
123
125
127
129
130private:
131 ConnStateData *conn_ = nullptr;
132 int fd_ = -1;
135
142};
143
145inline
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
void ACLCB(Acl::Answer, void *)
ACL checklist callback.
Definition Checklist.h:23
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
static MakingPointer Make(const acl_access *a, HttpRequest *r)
bool destinationDomainChecked() const
std::unique_ptr< ACLFilledChecklist > MakingPointer
ConnStateData * conn_
hack: client-to-Squid connection manager (if any)
ConnStateData * conn() const
The client connection manager.
void setRequest(HttpRequest *)
configure client request-related fields for the first time
~ACLFilledChecklist() override
ACLFilledChecklist(const ACLFilledChecklist &)
not implemented; will cause link failures if used
void setConn(ConnStateData *)
set either conn
const HttpReply & reply() const
void updateAle(const AccessLogEntry::Pointer &)
static void NonBlockingCheck(MakingPointer &&p, ACLCB *cb, void *data)
CBDATA_CLASS_WITH_MAKE(ACLFilledChecklist)
Security::CertPointer serverCert
void updateReply(const HttpReply::Pointer &)
int fd() const
The client side fd. It uses conn() if available.
ACLFilledChecklist & operator=(const ACLFilledChecklist &)
not implemented; will cause link failures if used
void verifyAle() const override
warns if there are uninitialized ALE components and fills them
CbcPointer< Security::CertErrors > sslErrors
bool hasAle() const override
bool sourceDomainChecked() const
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
Auth::UserRequest::Pointer auth_user_request
HttpReply::Pointer reply_
response added by updateReply() or nil
bool hasRequest() const override
ExternalACLEntryPointer extacl_entry
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
HttpRequest::Pointer request
bool hasReply() const override
Definition SBuf.h:94
err_type
Definition forward.h:14
@ ERR_MAX
Definition forward.h:88