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