]>
Commit | Line | Data |
---|---|---|
bbc27441 | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
bbc27441 AJ |
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 | ||
582c2af2 | 9 | #include "squid.h" |
2d46f579 AR |
10 | |
11 | /** This file exists to provide satic registration code to executables | |
12 | that need ACLs. We cannot place this code in acl/lib*.la because it | |
13 | does not get linked in, because nobody is using these classes by name. | |
14 | */ | |
15 | ||
c302ddb5 CT |
16 | #if USE_ADAPTATION |
17 | #include "acl/AdaptationService.h" | |
18 | #include "acl/AdaptationServiceData.h" | |
19 | #endif | |
6f58d7d7 AR |
20 | #include "acl/AllOf.h" |
21 | #include "acl/AnyOf.h" | |
32d002cb | 22 | #if USE_SQUID_EUI |
2d46f579 | 23 | #include "acl/Arp.h" |
a98c2da5 | 24 | #include "acl/Eui64.h" |
2d46f579 | 25 | #endif |
5d65362c | 26 | #if USE_OPENSSL |
8693472e CT |
27 | #include "acl/AtStep.h" |
28 | #include "acl/AtStepData.h" | |
5d65362c | 29 | #endif |
2d46f579 AR |
30 | #include "acl/Asn.h" |
31 | #include "acl/Browser.h" | |
32 | #include "acl/Checklist.h" | |
88df846b | 33 | #include "acl/ConnectionsEncrypted.h" |
2d46f579 AR |
34 | #include "acl/Data.h" |
35 | #include "acl/DestinationAsn.h" | |
36 | #include "acl/DestinationDomain.h" | |
37 | #include "acl/DestinationIp.h" | |
38 | #include "acl/DomainData.h" | |
2f1431ea | 39 | #if USE_AUTH |
2d46f579 | 40 | #include "acl/ExtUser.h" |
2f1431ea | 41 | #endif |
2d46f579 AR |
42 | #include "acl/FilledChecklist.h" |
43 | #include "acl/Gadgets.h" | |
bbaf2685 | 44 | #include "acl/HierCode.h" |
602d9612 | 45 | #include "acl/HierCodeData.h" |
2d46f579 AR |
46 | #include "acl/HttpHeaderData.h" |
47 | #include "acl/HttpRepHeader.h" | |
48 | #include "acl/HttpReqHeader.h" | |
49 | #include "acl/HttpStatus.h" | |
2d46f579 AR |
50 | #include "acl/IntRange.h" |
51 | #include "acl/Ip.h" | |
1e40905d AJ |
52 | #include "acl/LocalIp.h" |
53 | #include "acl/LocalPort.h" | |
2d46f579 | 54 | #include "acl/MaxConnection.h" |
2d46f579 | 55 | #include "acl/Method.h" |
602d9612 | 56 | #include "acl/MethodData.h" |
2d46f579 | 57 | #include "acl/MyPortName.h" |
39baccc8 CT |
58 | #include "acl/Note.h" |
59 | #include "acl/NoteData.h" | |
2d46f579 | 60 | #include "acl/PeerName.h" |
2d46f579 | 61 | #include "acl/Protocol.h" |
602d9612 | 62 | #include "acl/ProtocolData.h" |
cb1b906f | 63 | #include "acl/Random.h" |
2d46f579 AR |
64 | #include "acl/Referer.h" |
65 | #include "acl/RegexData.h" | |
66 | #include "acl/ReplyHeaderStrategy.h" | |
67 | #include "acl/ReplyMimeType.h" | |
68 | #include "acl/RequestHeaderStrategy.h" | |
69 | #include "acl/RequestMimeType.h" | |
70 | #include "acl/SourceAsn.h" | |
71 | #include "acl/SourceDomain.h" | |
72 | #include "acl/SourceIp.h" | |
3248e962 CT |
73 | #include "acl/SquidError.h" |
74 | #include "acl/SquidErrorData.h" | |
cb4f4424 | 75 | #if USE_OPENSSL |
2d46f579 | 76 | #include "acl/Certificate.h" |
602d9612 | 77 | #include "acl/CertificateData.h" |
69f69080 | 78 | #include "acl/ServerName.h" |
602d9612 A |
79 | #include "acl/SslError.h" |
80 | #include "acl/SslErrorData.h" | |
2d46f579 AR |
81 | #endif |
82 | #include "acl/Strategised.h" | |
83 | #include "acl/Strategy.h" | |
84 | #include "acl/StringData.h" | |
cb4f4424 | 85 | #if USE_OPENSSL |
00352183 AR |
86 | #include "acl/ServerCertificate.h" |
87 | #endif | |
bb5e7a79 | 88 | #include "acl/Tag.h" |
2d46f579 | 89 | #include "acl/Time.h" |
602d9612 | 90 | #include "acl/TimeData.h" |
2d46f579 | 91 | #include "acl/Url.h" |
9d35fe37 | 92 | #include "acl/UrlLogin.h" |
2d46f579 AR |
93 | #include "acl/UrlPath.h" |
94 | #include "acl/UrlPort.h" | |
95 | #include "acl/UserData.h" | |
2f1431ea | 96 | #if USE_AUTH |
abca32cf | 97 | #include "auth/AclMaxUserIp.h" |
602d9612 | 98 | #include "auth/AclProxyAuth.h" |
2f1431ea | 99 | #endif |
e2b74520 | 100 | #include "base/RegexPattern.h" |
4daaf3cb AJ |
101 | #if USE_IDENT |
102 | #include "ident/AclIdent.h" | |
103 | #endif | |
abca32cf | 104 | |
2d46f579 | 105 | ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser"); |
789217a2 | 106 | ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<Http::HdrType::USER_AGENT>::Instance(), "browser"); |
33810b1d | 107 | ACLFlag DestinationDomainFlags[] = {ACL_F_NO_LOOKUP, ACL_F_END}; |
2d46f579 | 108 | ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain"); |
33810b1d | 109 | ACLStrategised<char const *> ACLDestinationDomain::LiteralRegistryEntry_(new ACLDomainData, ACLDestinationDomainStrategy::Instance(), "dstdomain", DestinationDomainFlags); |
2d46f579 | 110 | ACL::Prototype ACLDestinationDomain::RegexRegistryProtoype(&ACLDestinationDomain::RegexRegistryEntry_, "dstdom_regex"); |
33810b1d CT |
111 | ACLFlag DestinationDomainRegexFlags[] = {ACL_F_NO_LOOKUP, ACL_F_REGEX_CASE, ACL_F_END}; |
112 | ACLStrategised<char const *> ACLDestinationDomain::RegexRegistryEntry_(new ACLRegexData,ACLDestinationDomainStrategy::Instance() ,"dstdom_regex", DestinationDomainRegexFlags); | |
2d46f579 AR |
113 | ACL::Prototype ACLDestinationIP::RegistryProtoype(&ACLDestinationIP::RegistryEntry_, "dst"); |
114 | ACLDestinationIP ACLDestinationIP::RegistryEntry_; | |
2f1431ea | 115 | #if USE_AUTH |
2d46f579 AR |
116 | ACL::Prototype ACLExtUser::UserRegistryProtoype(&ACLExtUser::UserRegistryEntry_, "ext_user"); |
117 | ACLExtUser ACLExtUser::UserRegistryEntry_(new ACLUserData, "ext_user"); | |
118 | ACL::Prototype ACLExtUser::RegexRegistryProtoype(&ACLExtUser::RegexRegistryEntry_, "ext_user_regex" ); | |
119 | ACLExtUser ACLExtUser::RegexRegistryEntry_(new ACLRegexData, "ext_user_regex"); | |
2f1431ea | 120 | #endif |
bbaf2685 AJ |
121 | ACL::Prototype ACLHierCode::RegistryProtoype(&ACLHierCode::RegistryEntry_, "hier_code"); |
122 | ACLStrategised<hier_code> ACLHierCode::RegistryEntry_(new ACLHierCodeData, ACLHierCodeStrategy::Instance(), "hier_code"); | |
2d46f579 AR |
123 | ACL::Prototype ACLHTTPRepHeader::RegistryProtoype(&ACLHTTPRepHeader::RegistryEntry_, "rep_header"); |
124 | ACLStrategised<HttpHeader*> ACLHTTPRepHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPRepHeaderStrategy::Instance(), "rep_header"); | |
125 | ACL::Prototype ACLHTTPReqHeader::RegistryProtoype(&ACLHTTPReqHeader::RegistryEntry_, "req_header"); | |
126 | ACLStrategised<HttpHeader*> ACLHTTPReqHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPReqHeaderStrategy::Instance(), "req_header"); | |
127 | ACL::Prototype ACLHTTPStatus::RegistryProtoype(&ACLHTTPStatus::RegistryEntry_, "http_status"); | |
128 | ACLHTTPStatus ACLHTTPStatus::RegistryEntry_("http_status"); | |
129 | ACL::Prototype ACLMaxConnection::RegistryProtoype(&ACLMaxConnection::RegistryEntry_, "maxconn"); | |
130 | ACLMaxConnection ACLMaxConnection::RegistryEntry_("maxconn"); | |
131 | ACL::Prototype ACLMethod::RegistryProtoype(&ACLMethod::RegistryEntry_, "method"); | |
132 | ACLStrategised<HttpRequestMethod> ACLMethod::RegistryEntry_(new ACLMethodData, ACLMethodStrategy::Instance(), "method"); | |
bb8466d6 | 133 | ACL::Prototype ACLLocalIP::RegistryProtoype(&ACLLocalIP::RegistryEntry_, "localip"); |
1e40905d AJ |
134 | ACLLocalIP ACLLocalIP::RegistryEntry_; |
135 | ACL::Prototype ACLLocalPort::RegistryProtoype(&ACLLocalPort::RegistryEntry_, "localport"); | |
136 | ACLStrategised<int> ACLLocalPort::RegistryEntry_(new ACLIntRange, ACLLocalPortStrategy::Instance(), "localport"); | |
2d46f579 AR |
137 | ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname"); |
138 | ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname"); | |
139 | ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername"); | |
140 | ACLStrategised<const char *> ACLPeerName::RegistryEntry_(new ACLStringData, ACLPeerNameStrategy::Instance(), "peername"); | |
16bdd4c0 AJ |
141 | ACL::Prototype ACLPeerName::RegexRegistryProtoype(&ACLPeerName::RegexRegistryEntry_, "peername_regex"); |
142 | ACLStrategised<char const *> ACLPeerName::RegexRegistryEntry_(new ACLRegexData, ACLPeerNameStrategy::Instance(), "peername_regex"); | |
2d46f579 | 143 | ACL::Prototype ACLProtocol::RegistryProtoype(&ACLProtocol::RegistryEntry_, "proto"); |
0c3d3f65 | 144 | ACLStrategised<AnyP::ProtocolType> ACLProtocol::RegistryEntry_(new ACLProtocolData, ACLProtocolStrategy::Instance(), "proto"); |
cb1b906f AJ |
145 | ACL::Prototype ACLRandom::RegistryProtoype(&ACLRandom::RegistryEntry_, "random"); |
146 | ACLRandom ACLRandom::RegistryEntry_("random"); | |
2d46f579 | 147 | ACL::Prototype ACLReferer::RegistryProtoype(&ACLReferer::RegistryEntry_, "referer_regex"); |
789217a2 | 148 | ACLStrategised<char const *> ACLReferer::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<Http::HdrType::REFERER>::Instance(), "referer_regex"); |
2d46f579 | 149 | ACL::Prototype ACLReplyMIMEType::RegistryProtoype(&ACLReplyMIMEType::RegistryEntry_, "rep_mime_type"); |
789217a2 | 150 | ACLStrategised<char const *> ACLReplyMIMEType::RegistryEntry_(new ACLRegexData, ACLReplyHeaderStrategy<Http::HdrType::CONTENT_TYPE>::Instance(), "rep_mime_type"); |
2d46f579 | 151 | ACL::Prototype ACLRequestMIMEType::RegistryProtoype(&ACLRequestMIMEType::RegistryEntry_, "req_mime_type"); |
789217a2 | 152 | ACLStrategised<char const *> ACLRequestMIMEType::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<Http::HdrType::CONTENT_TYPE>::Instance(), "req_mime_type"); |
2d46f579 AR |
153 | ACL::Prototype ACLSourceDomain::LiteralRegistryProtoype(&ACLSourceDomain::LiteralRegistryEntry_, "srcdomain"); |
154 | ACLStrategised<char const *> ACLSourceDomain::LiteralRegistryEntry_(new ACLDomainData, ACLSourceDomainStrategy::Instance(), "srcdomain"); | |
155 | ACL::Prototype ACLSourceDomain::RegexRegistryProtoype(&ACLSourceDomain::RegexRegistryEntry_, "srcdom_regex"); | |
156 | ACLStrategised<char const *> ACLSourceDomain::RegexRegistryEntry_(new ACLRegexData,ACLSourceDomainStrategy::Instance() ,"srcdom_regex"); | |
157 | ACL::Prototype ACLSourceIP::RegistryProtoype(&ACLSourceIP::RegistryEntry_, "src"); | |
158 | ACLSourceIP ACLSourceIP::RegistryEntry_; | |
159 | ACL::Prototype ACLTime::RegistryProtoype(&ACLTime::RegistryEntry_, "time"); | |
160 | ACLStrategised<time_t> ACLTime::RegistryEntry_(new ACLTimeData, ACLTimeStrategy::Instance(), "time"); | |
161 | ACL::Prototype ACLUrl::RegistryProtoype(&ACLUrl::RegistryEntry_, "url_regex"); | |
162 | ACLStrategised<char const *> ACLUrl::RegistryEntry_(new ACLRegexData, ACLUrlStrategy::Instance(), "url_regex"); | |
9d35fe37 AJ |
163 | ACL::Prototype ACLUrlLogin::RegistryProtoype(&ACLUrlLogin::RegistryEntry_, "urllogin"); |
164 | ACLStrategised<char const *> ACLUrlLogin::RegistryEntry_(new ACLRegexData, ACLUrlLoginStrategy::Instance(), "urllogin"); | |
2d46f579 AR |
165 | ACL::Prototype ACLUrlPath::LegacyRegistryProtoype(&ACLUrlPath::RegistryEntry_, "pattern"); |
166 | ACL::Prototype ACLUrlPath::RegistryProtoype(&ACLUrlPath::RegistryEntry_, "urlpath_regex"); | |
167 | ACLStrategised<char const *> ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrlPathStrategy::Instance(), "urlpath_regex"); | |
168 | ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port"); | |
169 | ACLStrategised<int> ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port"); | |
170 | ||
cb4f4424 | 171 | #if USE_OPENSSL |
af6a12ee | 172 | ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error"); |
92e3827b | 173 | ACLStrategised<const Security::CertErrors *> ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error"); |
af6a12ee | 174 | ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert"); |
00352183 | 175 | ACLStrategised<X509 *> ACLCertificate::UserRegistryEntry_(new ACLCertificateData (Ssl::GetX509UserAttribute, "*"), ACLCertificateStrategy::Instance(), "user_cert"); |
af6a12ee | 176 | ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEntry_, "ca_cert"); |
00352183 | 177 | ACLStrategised<X509 *> ACLCertificate::CARegistryEntry_(new ACLCertificateData (Ssl::GetX509CAAttribute, "*"), ACLCertificateStrategy::Instance(), "ca_cert"); |
72b12f9e CT |
178 | ACL::Prototype ACLServerCertificate::X509FingerprintRegistryProtoype(&ACLServerCertificate::X509FingerprintRegistryEntry_, "server_cert_fingerprint"); |
179 | ACLStrategised<X509 *> ACLServerCertificate::X509FingerprintRegistryEntry_(new ACLCertificateData(Ssl::GetX509Fingerprint, "-sha1", true), ACLServerCertificateStrategy::Instance(), "server_cert_fingerprint"); | |
5d65362c | 180 | |
652fcffd AR |
181 | ACL::Prototype ACLAtStep::RegistryProtoype(&ACLAtStep::RegistryEntry_, "at_step"); |
182 | ACLStrategised<Ssl::BumpStep> ACLAtStep::RegistryEntry_(new ACLAtStepData, ACLAtStepStrategy::Instance(), "at_step"); | |
69f69080 CT |
183 | |
184 | ACL::Prototype ACLServerName::LiteralRegistryProtoype(&ACLServerName::LiteralRegistryEntry_, "ssl::server_name"); | |
185 | ACLStrategised<char const *> ACLServerName::LiteralRegistryEntry_(new ACLServerNameData, ACLServerNameStrategy::Instance(), "ssl::server_name"); | |
186 | ACL::Prototype ACLServerName::RegexRegistryProtoype(&ACLServerName::RegexRegistryEntry_, "ssl::server_name_regex"); | |
187 | ACLFlag ServerNameRegexFlags[] = {ACL_F_REGEX_CASE, ACL_F_END}; | |
188 | ACLStrategised<char const *> ACLServerName::RegexRegistryEntry_(new ACLRegexData, ACLServerNameStrategy::Instance(), "ssl::server_name_regex", ServerNameRegexFlags); | |
2d46f579 AR |
189 | #endif |
190 | ||
32d002cb | 191 | #if USE_SQUID_EUI |
af6a12ee AJ |
192 | ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp"); |
193 | ACLARP ACLARP::RegistryEntry_("arp"); | |
a98c2da5 AJ |
194 | ACL::Prototype ACLEui64::RegistryProtoype(&ACLEui64::RegistryEntry_, "eui64"); |
195 | ACLEui64 ACLEui64::RegistryEntry_("eui64"); | |
2d46f579 AR |
196 | #endif |
197 | ||
ee326f02 | 198 | #if USE_IDENT |
af6a12ee AJ |
199 | ACL::Prototype ACLIdent::UserRegistryProtoype(&ACLIdent::UserRegistryEntry_, "ident"); |
200 | ACLIdent ACLIdent::UserRegistryEntry_(new ACLUserData, "ident"); | |
201 | ACL::Prototype ACLIdent::RegexRegistryProtoype(&ACLIdent::RegexRegistryEntry_, "ident_regex" ); | |
202 | ACLIdent ACLIdent::RegexRegistryEntry_(new ACLRegexData, "ident_regex"); | |
2d46f579 AR |
203 | #endif |
204 | ||
2f1431ea | 205 | #if USE_AUTH |
abca32cf CT |
206 | ACL::Prototype ACLProxyAuth::UserRegistryProtoype(&ACLProxyAuth::UserRegistryEntry_, "proxy_auth"); |
207 | ACLProxyAuth ACLProxyAuth::UserRegistryEntry_(new ACLUserData, "proxy_auth"); | |
208 | ACL::Prototype ACLProxyAuth::RegexRegistryProtoype(&ACLProxyAuth::RegexRegistryEntry_, "proxy_auth_regex" ); | |
209 | ACLProxyAuth ACLProxyAuth::RegexRegistryEntry_(new ACLRegexData, "proxy_auth_regex"); | |
2d46f579 | 210 | |
abca32cf CT |
211 | ACL::Prototype ACLMaxUserIP::RegistryProtoype(&ACLMaxUserIP::RegistryEntry_, "max_user_ip"); |
212 | ACLMaxUserIP ACLMaxUserIP::RegistryEntry_("max_user_ip"); | |
2f1431ea | 213 | #endif |
bb5e7a79 AJ |
214 | |
215 | ACL::Prototype ACLTag::RegistryProtoype(&ACLTag::RegistryEntry_, "tag"); | |
216 | ACLStrategised<const char *> ACLTag::RegistryEntry_(new ACLStringData, ACLTagStrategy::Instance(), "tag"); | |
6f58d7d7 AR |
217 | |
218 | ACL::Prototype Acl::AnyOf::RegistryProtoype(&Acl::AnyOf::RegistryEntry_, "any-of"); | |
219 | Acl::AnyOf Acl::AnyOf::RegistryEntry_; | |
220 | ||
221 | ACL::Prototype Acl::AllOf::RegistryProtoype(&Acl::AllOf::RegistryEntry_, "all-of"); | |
222 | Acl::AllOf Acl::AllOf::RegistryEntry_; | |
44b364a3 | 223 | |
39baccc8 | 224 | ACL::Prototype ACLNote::RegistryProtoype(&ACLNote::RegistryEntry_, "note"); |
76ee67ac | 225 | ACLStrategised<NotePairs::Entry *> ACLNote::RegistryEntry_(new ACLNoteData, ACLNoteStrategy::Instance(), "note"); |
c302ddb5 CT |
226 | |
227 | #if USE_ADAPTATION | |
228 | ACL::Prototype ACLAdaptationService::RegistryProtoype(&ACLAdaptationService::RegistryEntry_, "adaptation_service"); | |
229 | ACLStrategised<const char *> ACLAdaptationService::RegistryEntry_(new ACLAdaptationServiceData, ACLAdaptationServiceStrategy::Instance(), "adaptation_service"); | |
230 | #endif | |
f53969cc | 231 | |
3248e962 CT |
232 | ACL::Prototype ACLSquidError::RegistryProtoype(&ACLSquidError::RegistryEntry_, "squid_error"); |
233 | ACLStrategised<err_type> ACLSquidError::RegistryEntry_(new ACLSquidErrorData, ACLSquidErrorStrategy::Instance(), "squid_error"); | |
44352c16 | 234 | |
88df846b CT |
235 | ACL::Prototype Acl::ConnectionsEncrypted::RegistryProtoype(&Acl::ConnectionsEncrypted::RegistryEntry_, "connections_encrypted"); |
236 | Acl::ConnectionsEncrypted Acl::ConnectionsEncrypted::RegistryEntry_("connections_encrypted"); | |
ff89bfa0 | 237 |