source: squid-ssl/trunk/fuentes/src/acl/FilledChecklist.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 2 years ago

Initial release

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