]> git.ipfire.org Git - thirdparty/squid.git/blame - src/AclRegs.cc
Fix http_hdr_type layering constraint violations in external_acl.cc
[thirdparty/squid.git] / src / AclRegs.cc
CommitLineData
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
104ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser");
105ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_USER_AGENT>::Instance(), "browser");
33810b1d 106ACLFlag DestinationDomainFlags[] = {ACL_F_NO_LOOKUP, ACL_F_END};
2d46f579 107ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain");
33810b1d 108ACLStrategised<char const *> ACLDestinationDomain::LiteralRegistryEntry_(new ACLDomainData, ACLDestinationDomainStrategy::Instance(), "dstdomain", DestinationDomainFlags);
2d46f579 109ACL::Prototype ACLDestinationDomain::RegexRegistryProtoype(&ACLDestinationDomain::RegexRegistryEntry_, "dstdom_regex");
33810b1d
CT
110ACLFlag DestinationDomainRegexFlags[] = {ACL_F_NO_LOOKUP, ACL_F_REGEX_CASE, ACL_F_END};
111ACLStrategised<char const *> ACLDestinationDomain::RegexRegistryEntry_(new ACLRegexData,ACLDestinationDomainStrategy::Instance() ,"dstdom_regex", DestinationDomainRegexFlags);
2d46f579
AR
112ACL::Prototype ACLDestinationIP::RegistryProtoype(&ACLDestinationIP::RegistryEntry_, "dst");
113ACLDestinationIP ACLDestinationIP::RegistryEntry_;
2f1431ea 114#if USE_AUTH
2d46f579
AR
115ACL::Prototype ACLExtUser::UserRegistryProtoype(&ACLExtUser::UserRegistryEntry_, "ext_user");
116ACLExtUser ACLExtUser::UserRegistryEntry_(new ACLUserData, "ext_user");
117ACL::Prototype ACLExtUser::RegexRegistryProtoype(&ACLExtUser::RegexRegistryEntry_, "ext_user_regex" );
118ACLExtUser ACLExtUser::RegexRegistryEntry_(new ACLRegexData, "ext_user_regex");
2f1431ea 119#endif
bbaf2685
AJ
120ACL::Prototype ACLHierCode::RegistryProtoype(&ACLHierCode::RegistryEntry_, "hier_code");
121ACLStrategised<hier_code> ACLHierCode::RegistryEntry_(new ACLHierCodeData, ACLHierCodeStrategy::Instance(), "hier_code");
2d46f579
AR
122ACL::Prototype ACLHTTPRepHeader::RegistryProtoype(&ACLHTTPRepHeader::RegistryEntry_, "rep_header");
123ACLStrategised<HttpHeader*> ACLHTTPRepHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPRepHeaderStrategy::Instance(), "rep_header");
124ACL::Prototype ACLHTTPReqHeader::RegistryProtoype(&ACLHTTPReqHeader::RegistryEntry_, "req_header");
125ACLStrategised<HttpHeader*> ACLHTTPReqHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPReqHeaderStrategy::Instance(), "req_header");
126ACL::Prototype ACLHTTPStatus::RegistryProtoype(&ACLHTTPStatus::RegistryEntry_, "http_status");
127ACLHTTPStatus ACLHTTPStatus::RegistryEntry_("http_status");
128ACL::Prototype ACLMaxConnection::RegistryProtoype(&ACLMaxConnection::RegistryEntry_, "maxconn");
129ACLMaxConnection ACLMaxConnection::RegistryEntry_("maxconn");
130ACL::Prototype ACLMethod::RegistryProtoype(&ACLMethod::RegistryEntry_, "method");
131ACLStrategised<HttpRequestMethod> ACLMethod::RegistryEntry_(new ACLMethodData, ACLMethodStrategy::Instance(), "method");
bb8466d6 132ACL::Prototype ACLLocalIP::RegistryProtoype(&ACLLocalIP::RegistryEntry_, "localip");
1e40905d
AJ
133ACLLocalIP ACLLocalIP::RegistryEntry_;
134ACL::Prototype ACLLocalPort::RegistryProtoype(&ACLLocalPort::RegistryEntry_, "localport");
135ACLStrategised<int> ACLLocalPort::RegistryEntry_(new ACLIntRange, ACLLocalPortStrategy::Instance(), "localport");
2d46f579
AR
136ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname");
137ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname");
138ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername");
139ACLStrategised<const char *> ACLPeerName::RegistryEntry_(new ACLStringData, ACLPeerNameStrategy::Instance(), "peername");
16bdd4c0
AJ
140ACL::Prototype ACLPeerName::RegexRegistryProtoype(&ACLPeerName::RegexRegistryEntry_, "peername_regex");
141ACLStrategised<char const *> ACLPeerName::RegexRegistryEntry_(new ACLRegexData, ACLPeerNameStrategy::Instance(), "peername_regex");
2d46f579 142ACL::Prototype ACLProtocol::RegistryProtoype(&ACLProtocol::RegistryEntry_, "proto");
0c3d3f65 143ACLStrategised<AnyP::ProtocolType> ACLProtocol::RegistryEntry_(new ACLProtocolData, ACLProtocolStrategy::Instance(), "proto");
cb1b906f
AJ
144ACL::Prototype ACLRandom::RegistryProtoype(&ACLRandom::RegistryEntry_, "random");
145ACLRandom ACLRandom::RegistryEntry_("random");
2d46f579
AR
146ACL::Prototype ACLReferer::RegistryProtoype(&ACLReferer::RegistryEntry_, "referer_regex");
147ACLStrategised<char const *> ACLReferer::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_REFERER>::Instance(), "referer_regex");
148ACL::Prototype ACLReplyMIMEType::RegistryProtoype(&ACLReplyMIMEType::RegistryEntry_, "rep_mime_type");
149ACLStrategised<char const *> ACLReplyMIMEType::RegistryEntry_(new ACLRegexData, ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "rep_mime_type");
150ACL::Prototype ACLRequestMIMEType::RegistryProtoype(&ACLRequestMIMEType::RegistryEntry_, "req_mime_type");
151ACLStrategised<char const *> ACLRequestMIMEType::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "req_mime_type");
152ACL::Prototype ACLSourceDomain::LiteralRegistryProtoype(&ACLSourceDomain::LiteralRegistryEntry_, "srcdomain");
153ACLStrategised<char const *> ACLSourceDomain::LiteralRegistryEntry_(new ACLDomainData, ACLSourceDomainStrategy::Instance(), "srcdomain");
154ACL::Prototype ACLSourceDomain::RegexRegistryProtoype(&ACLSourceDomain::RegexRegistryEntry_, "srcdom_regex");
155ACLStrategised<char const *> ACLSourceDomain::RegexRegistryEntry_(new ACLRegexData,ACLSourceDomainStrategy::Instance() ,"srcdom_regex");
156ACL::Prototype ACLSourceIP::RegistryProtoype(&ACLSourceIP::RegistryEntry_, "src");
157ACLSourceIP ACLSourceIP::RegistryEntry_;
158ACL::Prototype ACLTime::RegistryProtoype(&ACLTime::RegistryEntry_, "time");
159ACLStrategised<time_t> ACLTime::RegistryEntry_(new ACLTimeData, ACLTimeStrategy::Instance(), "time");
160ACL::Prototype ACLUrl::RegistryProtoype(&ACLUrl::RegistryEntry_, "url_regex");
161ACLStrategised<char const *> ACLUrl::RegistryEntry_(new ACLRegexData, ACLUrlStrategy::Instance(), "url_regex");
9d35fe37
AJ
162ACL::Prototype ACLUrlLogin::RegistryProtoype(&ACLUrlLogin::RegistryEntry_, "urllogin");
163ACLStrategised<char const *> ACLUrlLogin::RegistryEntry_(new ACLRegexData, ACLUrlLoginStrategy::Instance(), "urllogin");
2d46f579
AR
164ACL::Prototype ACLUrlPath::LegacyRegistryProtoype(&ACLUrlPath::RegistryEntry_, "pattern");
165ACL::Prototype ACLUrlPath::RegistryProtoype(&ACLUrlPath::RegistryEntry_, "urlpath_regex");
166ACLStrategised<char const *> ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrlPathStrategy::Instance(), "urlpath_regex");
167ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port");
168ACLStrategised<int> ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port");
169
cb4f4424 170#if USE_OPENSSL
af6a12ee 171ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error");
62a7607e 172ACLStrategised<const Ssl::CertErrors *> ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error");
af6a12ee 173ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert");
00352183 174ACLStrategised<X509 *> ACLCertificate::UserRegistryEntry_(new ACLCertificateData (Ssl::GetX509UserAttribute, "*"), ACLCertificateStrategy::Instance(), "user_cert");
af6a12ee 175ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEntry_, "ca_cert");
00352183 176ACLStrategised<X509 *> ACLCertificate::CARegistryEntry_(new ACLCertificateData (Ssl::GetX509CAAttribute, "*"), ACLCertificateStrategy::Instance(), "ca_cert");
72b12f9e
CT
177ACL::Prototype ACLServerCertificate::X509FingerprintRegistryProtoype(&ACLServerCertificate::X509FingerprintRegistryEntry_, "server_cert_fingerprint");
178ACLStrategised<X509 *> ACLServerCertificate::X509FingerprintRegistryEntry_(new ACLCertificateData(Ssl::GetX509Fingerprint, "-sha1", true), ACLServerCertificateStrategy::Instance(), "server_cert_fingerprint");
5d65362c 179
652fcffd
AR
180ACL::Prototype ACLAtStep::RegistryProtoype(&ACLAtStep::RegistryEntry_, "at_step");
181ACLStrategised<Ssl::BumpStep> ACLAtStep::RegistryEntry_(new ACLAtStepData, ACLAtStepStrategy::Instance(), "at_step");
69f69080
CT
182
183ACL::Prototype ACLServerName::LiteralRegistryProtoype(&ACLServerName::LiteralRegistryEntry_, "ssl::server_name");
184ACLStrategised<char const *> ACLServerName::LiteralRegistryEntry_(new ACLServerNameData, ACLServerNameStrategy::Instance(), "ssl::server_name");
185ACL::Prototype ACLServerName::RegexRegistryProtoype(&ACLServerName::RegexRegistryEntry_, "ssl::server_name_regex");
186ACLFlag ServerNameRegexFlags[] = {ACL_F_REGEX_CASE, ACL_F_END};
187ACLStrategised<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
191ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp");
192ACLARP ACLARP::RegistryEntry_("arp");
a98c2da5
AJ
193ACL::Prototype ACLEui64::RegistryProtoype(&ACLEui64::RegistryEntry_, "eui64");
194ACLEui64 ACLEui64::RegistryEntry_("eui64");
2d46f579
AR
195#endif
196
ee326f02 197#if USE_IDENT
af6a12ee
AJ
198ACL::Prototype ACLIdent::UserRegistryProtoype(&ACLIdent::UserRegistryEntry_, "ident");
199ACLIdent ACLIdent::UserRegistryEntry_(new ACLUserData, "ident");
200ACL::Prototype ACLIdent::RegexRegistryProtoype(&ACLIdent::RegexRegistryEntry_, "ident_regex" );
201ACLIdent ACLIdent::RegexRegistryEntry_(new ACLRegexData, "ident_regex");
2d46f579
AR
202#endif
203
2f1431ea 204#if USE_AUTH
abca32cf
CT
205ACL::Prototype ACLProxyAuth::UserRegistryProtoype(&ACLProxyAuth::UserRegistryEntry_, "proxy_auth");
206ACLProxyAuth ACLProxyAuth::UserRegistryEntry_(new ACLUserData, "proxy_auth");
207ACL::Prototype ACLProxyAuth::RegexRegistryProtoype(&ACLProxyAuth::RegexRegistryEntry_, "proxy_auth_regex" );
208ACLProxyAuth ACLProxyAuth::RegexRegistryEntry_(new ACLRegexData, "proxy_auth_regex");
2d46f579 209
abca32cf
CT
210ACL::Prototype ACLMaxUserIP::RegistryProtoype(&ACLMaxUserIP::RegistryEntry_, "max_user_ip");
211ACLMaxUserIP ACLMaxUserIP::RegistryEntry_("max_user_ip");
2f1431ea 212#endif
bb5e7a79
AJ
213
214ACL::Prototype ACLTag::RegistryProtoype(&ACLTag::RegistryEntry_, "tag");
215ACLStrategised<const char *> ACLTag::RegistryEntry_(new ACLStringData, ACLTagStrategy::Instance(), "tag");
6f58d7d7
AR
216
217ACL::Prototype Acl::AnyOf::RegistryProtoype(&Acl::AnyOf::RegistryEntry_, "any-of");
218Acl::AnyOf Acl::AnyOf::RegistryEntry_;
219
220ACL::Prototype Acl::AllOf::RegistryProtoype(&Acl::AllOf::RegistryEntry_, "all-of");
221Acl::AllOf Acl::AllOf::RegistryEntry_;
44b364a3 222
39baccc8
CT
223ACL::Prototype ACLNote::RegistryProtoype(&ACLNote::RegistryEntry_, "note");
224ACLStrategised<HttpRequest *> ACLNote::RegistryEntry_(new ACLNoteData, ACLNoteStrategy::Instance(), "note");
c302ddb5
CT
225
226#if USE_ADAPTATION
227ACL::Prototype ACLAdaptationService::RegistryProtoype(&ACLAdaptationService::RegistryEntry_, "adaptation_service");
228ACLStrategised<const char *> ACLAdaptationService::RegistryEntry_(new ACLAdaptationServiceData, ACLAdaptationServiceStrategy::Instance(), "adaptation_service");
229#endif
f53969cc 230
3248e962
CT
231ACL::Prototype ACLSquidError::RegistryProtoype(&ACLSquidError::RegistryEntry_, "squid_error");
232ACLStrategised<err_type> ACLSquidError::RegistryEntry_(new ACLSquidErrorData, ACLSquidErrorStrategy::Instance(), "squid_error");
44352c16 233