]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AclRegs.cc
Tying validation errors to certificates
[thirdparty/squid.git] / src / AclRegs.cc
1 #include "squid.h"
2
3 /** This file exists to provide satic registration code to executables
4 that need ACLs. We cannot place this code in acl/lib*.la because it
5 does not get linked in, because nobody is using these classes by name.
6 */
7
8 #include "acl/AllOf.h"
9 #include "acl/AnyOf.h"
10 #if USE_SQUID_EUI
11 #include "acl/Arp.h"
12 #include "acl/Eui64.h"
13 #endif
14 #include "acl/Asn.h"
15 #include "acl/Browser.h"
16 #include "acl/Checklist.h"
17 #include "acl/Data.h"
18 #include "acl/DestinationAsn.h"
19 #include "acl/DestinationDomain.h"
20 #include "acl/DestinationIp.h"
21 #include "acl/DomainData.h"
22 #if USE_AUTH
23 #include "acl/ExtUser.h"
24 #endif
25 #include "acl/FilledChecklist.h"
26 #include "acl/Gadgets.h"
27 #include "acl/HierCodeData.h"
28 #include "acl/HierCode.h"
29 #include "acl/HttpHeaderData.h"
30 #include "acl/HttpRepHeader.h"
31 #include "acl/HttpReqHeader.h"
32 #include "acl/HttpStatus.h"
33 #include "acl/IntRange.h"
34 #include "acl/Ip.h"
35 #include "acl/LocalIp.h"
36 #include "acl/LocalPort.h"
37 #include "acl/MaxConnection.h"
38 #include "acl/MethodData.h"
39 #include "acl/Method.h"
40 #include "acl/MyPortName.h"
41 #include "acl/Note.h"
42 #include "acl/NoteData.h"
43 #include "acl/PeerName.h"
44 #include "acl/ProtocolData.h"
45 #include "acl/Protocol.h"
46 #include "acl/Random.h"
47 #include "acl/Referer.h"
48 #include "acl/RegexData.h"
49 #include "acl/ReplyHeaderStrategy.h"
50 #include "acl/ReplyMimeType.h"
51 #include "acl/RequestHeaderStrategy.h"
52 #include "acl/RequestMimeType.h"
53 #include "acl/SourceAsn.h"
54 #include "acl/SourceDomain.h"
55 #include "acl/SourceIp.h"
56 #if USE_SSL
57 #include "acl/SslErrorData.h"
58 #include "acl/SslError.h"
59 #include "acl/CertificateData.h"
60 #include "acl/Certificate.h"
61 #endif
62 #include "acl/Strategised.h"
63 #include "acl/Strategy.h"
64 #include "acl/StringData.h"
65 #if USE_SSL
66 #include "acl/ServerCertificate.h"
67 #endif
68 #include "acl/Tag.h"
69 #include "acl/TimeData.h"
70 #include "acl/Time.h"
71 #include "acl/Url.h"
72 #include "acl/UrlLogin.h"
73 #include "acl/UrlPath.h"
74 #include "acl/UrlPort.h"
75 #include "acl/UserData.h"
76 #if USE_AUTH
77 #include "auth/AclProxyAuth.h"
78 #include "auth/AclMaxUserIp.h"
79 #endif
80 #if USE_IDENT
81 #include "ident/AclIdent.h"
82 #endif
83
84 ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser");
85 ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_USER_AGENT>::Instance(), "browser");
86 ACLFlag DestinationDomainFlags[] = {ACL_F_NO_LOOKUP, ACL_F_END};
87 ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain");
88 ACLStrategised<char const *> ACLDestinationDomain::LiteralRegistryEntry_(new ACLDomainData, ACLDestinationDomainStrategy::Instance(), "dstdomain", DestinationDomainFlags);
89 ACL::Prototype ACLDestinationDomain::RegexRegistryProtoype(&ACLDestinationDomain::RegexRegistryEntry_, "dstdom_regex");
90 ACLFlag DestinationDomainRegexFlags[] = {ACL_F_NO_LOOKUP, ACL_F_REGEX_CASE, ACL_F_END};
91 ACLStrategised<char const *> ACLDestinationDomain::RegexRegistryEntry_(new ACLRegexData,ACLDestinationDomainStrategy::Instance() ,"dstdom_regex", DestinationDomainRegexFlags);
92 ACL::Prototype ACLDestinationIP::RegistryProtoype(&ACLDestinationIP::RegistryEntry_, "dst");
93 ACLDestinationIP ACLDestinationIP::RegistryEntry_;
94 #if USE_AUTH
95 ACL::Prototype ACLExtUser::UserRegistryProtoype(&ACLExtUser::UserRegistryEntry_, "ext_user");
96 ACLExtUser ACLExtUser::UserRegistryEntry_(new ACLUserData, "ext_user");
97 ACL::Prototype ACLExtUser::RegexRegistryProtoype(&ACLExtUser::RegexRegistryEntry_, "ext_user_regex" );
98 ACLExtUser ACLExtUser::RegexRegistryEntry_(new ACLRegexData, "ext_user_regex");
99 #endif
100 ACL::Prototype ACLHierCode::RegistryProtoype(&ACLHierCode::RegistryEntry_, "hier_code");
101 ACLStrategised<hier_code> ACLHierCode::RegistryEntry_(new ACLHierCodeData, ACLHierCodeStrategy::Instance(), "hier_code");
102 ACL::Prototype ACLHTTPRepHeader::RegistryProtoype(&ACLHTTPRepHeader::RegistryEntry_, "rep_header");
103 ACLStrategised<HttpHeader*> ACLHTTPRepHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPRepHeaderStrategy::Instance(), "rep_header");
104 ACL::Prototype ACLHTTPReqHeader::RegistryProtoype(&ACLHTTPReqHeader::RegistryEntry_, "req_header");
105 ACLStrategised<HttpHeader*> ACLHTTPReqHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPReqHeaderStrategy::Instance(), "req_header");
106 ACL::Prototype ACLHTTPStatus::RegistryProtoype(&ACLHTTPStatus::RegistryEntry_, "http_status");
107 ACLHTTPStatus ACLHTTPStatus::RegistryEntry_("http_status");
108 ACL::Prototype ACLMaxConnection::RegistryProtoype(&ACLMaxConnection::RegistryEntry_, "maxconn");
109 ACLMaxConnection ACLMaxConnection::RegistryEntry_("maxconn");
110 ACL::Prototype ACLMethod::RegistryProtoype(&ACLMethod::RegistryEntry_, "method");
111 ACLStrategised<HttpRequestMethod> ACLMethod::RegistryEntry_(new ACLMethodData, ACLMethodStrategy::Instance(), "method");
112 ACL::Prototype ACLLocalIP::RegistryProtoype(&ACLLocalIP::RegistryEntry_, "localip");
113 ACLLocalIP ACLLocalIP::RegistryEntry_;
114 ACL::Prototype ACLLocalPort::RegistryProtoype(&ACLLocalPort::RegistryEntry_, "localport");
115 ACLStrategised<int> ACLLocalPort::RegistryEntry_(new ACLIntRange, ACLLocalPortStrategy::Instance(), "localport");
116 ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname");
117 ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname");
118 ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername");
119 ACLStrategised<const char *> ACLPeerName::RegistryEntry_(new ACLStringData, ACLPeerNameStrategy::Instance(), "peername");
120 ACL::Prototype ACLPeerName::RegexRegistryProtoype(&ACLPeerName::RegexRegistryEntry_, "peername_regex");
121 ACLStrategised<char const *> ACLPeerName::RegexRegistryEntry_(new ACLRegexData, ACLPeerNameStrategy::Instance(), "peername_regex");
122 ACL::Prototype ACLProtocol::RegistryProtoype(&ACLProtocol::RegistryEntry_, "proto");
123 ACLStrategised<AnyP::ProtocolType> ACLProtocol::RegistryEntry_(new ACLProtocolData, ACLProtocolStrategy::Instance(), "proto");
124 ACL::Prototype ACLRandom::RegistryProtoype(&ACLRandom::RegistryEntry_, "random");
125 ACLRandom ACLRandom::RegistryEntry_("random");
126 ACL::Prototype ACLReferer::RegistryProtoype(&ACLReferer::RegistryEntry_, "referer_regex");
127 ACLStrategised<char const *> ACLReferer::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_REFERER>::Instance(), "referer_regex");
128 ACL::Prototype ACLReplyMIMEType::RegistryProtoype(&ACLReplyMIMEType::RegistryEntry_, "rep_mime_type");
129 ACLStrategised<char const *> ACLReplyMIMEType::RegistryEntry_(new ACLRegexData, ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "rep_mime_type");
130 ACL::Prototype ACLRequestMIMEType::RegistryProtoype(&ACLRequestMIMEType::RegistryEntry_, "req_mime_type");
131 ACLStrategised<char const *> ACLRequestMIMEType::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "req_mime_type");
132 ACL::Prototype ACLSourceDomain::LiteralRegistryProtoype(&ACLSourceDomain::LiteralRegistryEntry_, "srcdomain");
133 ACLStrategised<char const *> ACLSourceDomain::LiteralRegistryEntry_(new ACLDomainData, ACLSourceDomainStrategy::Instance(), "srcdomain");
134 ACL::Prototype ACLSourceDomain::RegexRegistryProtoype(&ACLSourceDomain::RegexRegistryEntry_, "srcdom_regex");
135 ACLStrategised<char const *> ACLSourceDomain::RegexRegistryEntry_(new ACLRegexData,ACLSourceDomainStrategy::Instance() ,"srcdom_regex");
136 ACL::Prototype ACLSourceIP::RegistryProtoype(&ACLSourceIP::RegistryEntry_, "src");
137 ACLSourceIP ACLSourceIP::RegistryEntry_;
138 ACL::Prototype ACLTime::RegistryProtoype(&ACLTime::RegistryEntry_, "time");
139 ACLStrategised<time_t> ACLTime::RegistryEntry_(new ACLTimeData, ACLTimeStrategy::Instance(), "time");
140 ACL::Prototype ACLUrl::RegistryProtoype(&ACLUrl::RegistryEntry_, "url_regex");
141 ACLStrategised<char const *> ACLUrl::RegistryEntry_(new ACLRegexData, ACLUrlStrategy::Instance(), "url_regex");
142 ACL::Prototype ACLUrlLogin::RegistryProtoype(&ACLUrlLogin::RegistryEntry_, "urllogin");
143 ACLStrategised<char const *> ACLUrlLogin::RegistryEntry_(new ACLRegexData, ACLUrlLoginStrategy::Instance(), "urllogin");
144 ACL::Prototype ACLUrlPath::LegacyRegistryProtoype(&ACLUrlPath::RegistryEntry_, "pattern");
145 ACL::Prototype ACLUrlPath::RegistryProtoype(&ACLUrlPath::RegistryEntry_, "urlpath_regex");
146 ACLStrategised<char const *> ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrlPathStrategy::Instance(), "urlpath_regex");
147 ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port");
148 ACLStrategised<int> ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port");
149
150 #if USE_SSL
151 ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error");
152 ACLStrategised<const Ssl::CertErrors *> ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error");
153 ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert");
154 ACLStrategised<X509 *> ACLCertificate::UserRegistryEntry_(new ACLCertificateData (Ssl::GetX509UserAttribute, "*"), ACLCertificateStrategy::Instance(), "user_cert");
155 ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEntry_, "ca_cert");
156 ACLStrategised<X509 *> ACLCertificate::CARegistryEntry_(new ACLCertificateData (Ssl::GetX509CAAttribute, "*"), ACLCertificateStrategy::Instance(), "ca_cert");
157 ACL::Prototype ACLServerCertificate::X509FingerprintRegistryProtoype(&ACLServerCertificate::X509FingerprintRegistryEntry_, "server_cert_fingerprint");
158 ACLStrategised<X509 *> ACLServerCertificate::X509FingerprintRegistryEntry_(new ACLCertificateData(Ssl::GetX509Fingerprint, "-sha1", true), ACLServerCertificateStrategy::Instance(), "server_cert_fingerprint");
159 #endif
160
161 #if USE_SQUID_EUI
162 ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp");
163 ACLARP ACLARP::RegistryEntry_("arp");
164 ACL::Prototype ACLEui64::RegistryProtoype(&ACLEui64::RegistryEntry_, "eui64");
165 ACLEui64 ACLEui64::RegistryEntry_("eui64");
166 #endif
167
168 #if USE_IDENT
169 ACL::Prototype ACLIdent::UserRegistryProtoype(&ACLIdent::UserRegistryEntry_, "ident");
170 ACLIdent ACLIdent::UserRegistryEntry_(new ACLUserData, "ident");
171 ACL::Prototype ACLIdent::RegexRegistryProtoype(&ACLIdent::RegexRegistryEntry_, "ident_regex" );
172 ACLIdent ACLIdent::RegexRegistryEntry_(new ACLRegexData, "ident_regex");
173 #endif
174
175 #if USE_AUTH
176 ACL::Prototype ACLProxyAuth::UserRegistryProtoype(&ACLProxyAuth::UserRegistryEntry_, "proxy_auth");
177 ACLProxyAuth ACLProxyAuth::UserRegistryEntry_(new ACLUserData, "proxy_auth");
178 ACL::Prototype ACLProxyAuth::RegexRegistryProtoype(&ACLProxyAuth::RegexRegistryEntry_, "proxy_auth_regex" );
179 ACLProxyAuth ACLProxyAuth::RegexRegistryEntry_(new ACLRegexData, "proxy_auth_regex");
180
181 ACL::Prototype ACLMaxUserIP::RegistryProtoype(&ACLMaxUserIP::RegistryEntry_, "max_user_ip");
182 ACLMaxUserIP ACLMaxUserIP::RegistryEntry_("max_user_ip");
183 #endif
184
185 ACL::Prototype ACLTag::RegistryProtoype(&ACLTag::RegistryEntry_, "tag");
186 ACLStrategised<const char *> ACLTag::RegistryEntry_(new ACLStringData, ACLTagStrategy::Instance(), "tag");
187
188 ACL::Prototype Acl::AnyOf::RegistryProtoype(&Acl::AnyOf::RegistryEntry_, "any-of");
189 Acl::AnyOf Acl::AnyOf::RegistryEntry_;
190
191 ACL::Prototype Acl::AllOf::RegistryProtoype(&Acl::AllOf::RegistryEntry_, "all-of");
192 Acl::AllOf Acl::AllOf::RegistryEntry_;
193
194 ACL::Prototype ACLNote::RegistryProtoype(&ACLNote::RegistryEntry_, "note");
195 ACLStrategised<HttpRequest *> ACLNote::RegistryEntry_(new ACLNoteData, ACLNoteStrategy::Instance(), "note");