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