]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AclRegs.cc
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / AclRegs.cc
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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
9 #include "squid.h"
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
16 #if USE_ADAPTATION
17 #include "acl/AdaptationService.h"
18 #include "acl/AdaptationServiceData.h"
19 #endif
20 #include "acl/AllOf.h"
21 #include "acl/AnyOf.h"
22 #if USE_SQUID_EUI
23 #include "acl/Arp.h"
24 #include "acl/Eui64.h"
25 #endif
26 #if USE_OPENSSL
27 #include "acl/AtStep.h"
28 #include "acl/AtStepData.h"
29 #endif
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"
38 #if USE_AUTH
39 #include "acl/ExtUser.h"
40 #endif
41 #include "acl/FilledChecklist.h"
42 #include "acl/Gadgets.h"
43 #include "acl/HierCode.h"
44 #include "acl/HierCodeData.h"
45 #include "acl/HttpHeaderData.h"
46 #include "acl/HttpRepHeader.h"
47 #include "acl/HttpReqHeader.h"
48 #include "acl/HttpStatus.h"
49 #include "acl/IntRange.h"
50 #include "acl/Ip.h"
51 #include "acl/LocalIp.h"
52 #include "acl/LocalPort.h"
53 #include "acl/MaxConnection.h"
54 #include "acl/Method.h"
55 #include "acl/MethodData.h"
56 #include "acl/MyPortName.h"
57 #include "acl/Note.h"
58 #include "acl/NoteData.h"
59 #include "acl/PeerName.h"
60 #include "acl/Protocol.h"
61 #include "acl/ProtocolData.h"
62 #include "acl/Random.h"
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"
72 #if USE_OPENSSL
73 #include "acl/Certificate.h"
74 #include "acl/CertificateData.h"
75 #include "acl/SslError.h"
76 #include "acl/SslErrorData.h"
77 #endif
78 #include "acl/Strategised.h"
79 #include "acl/Strategy.h"
80 #include "acl/StringData.h"
81 #if USE_OPENSSL
82 #include "acl/ServerCertificate.h"
83 #endif
84 #include "acl/Tag.h"
85 #include "acl/Time.h"
86 #include "acl/TimeData.h"
87 #include "acl/Url.h"
88 #include "acl/UrlLogin.h"
89 #include "acl/UrlPath.h"
90 #include "acl/UrlPort.h"
91 #include "acl/UserData.h"
92 #if USE_AUTH
93 #include "auth/AclMaxUserIp.h"
94 #include "auth/AclProxyAuth.h"
95 #endif
96 #if USE_IDENT
97 #include "ident/AclIdent.h"
98 #endif
99
100 ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser");
101 ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_USER_AGENT>::Instance(), "browser");
102 ACLFlag DestinationDomainFlags[] = {ACL_F_NO_LOOKUP, ACL_F_END};
103 ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain");
104 ACLStrategised<char const *> ACLDestinationDomain::LiteralRegistryEntry_(new ACLDomainData, ACLDestinationDomainStrategy::Instance(), "dstdomain", DestinationDomainFlags);
105 ACL::Prototype ACLDestinationDomain::RegexRegistryProtoype(&ACLDestinationDomain::RegexRegistryEntry_, "dstdom_regex");
106 ACLFlag DestinationDomainRegexFlags[] = {ACL_F_NO_LOOKUP, ACL_F_REGEX_CASE, ACL_F_END};
107 ACLStrategised<char const *> ACLDestinationDomain::RegexRegistryEntry_(new ACLRegexData,ACLDestinationDomainStrategy::Instance() ,"dstdom_regex", DestinationDomainRegexFlags);
108 ACL::Prototype ACLDestinationIP::RegistryProtoype(&ACLDestinationIP::RegistryEntry_, "dst");
109 ACLDestinationIP ACLDestinationIP::RegistryEntry_;
110 #if USE_AUTH
111 ACL::Prototype ACLExtUser::UserRegistryProtoype(&ACLExtUser::UserRegistryEntry_, "ext_user");
112 ACLExtUser ACLExtUser::UserRegistryEntry_(new ACLUserData, "ext_user");
113 ACL::Prototype ACLExtUser::RegexRegistryProtoype(&ACLExtUser::RegexRegistryEntry_, "ext_user_regex" );
114 ACLExtUser ACLExtUser::RegexRegistryEntry_(new ACLRegexData, "ext_user_regex");
115 #endif
116 ACL::Prototype ACLHierCode::RegistryProtoype(&ACLHierCode::RegistryEntry_, "hier_code");
117 ACLStrategised<hier_code> ACLHierCode::RegistryEntry_(new ACLHierCodeData, ACLHierCodeStrategy::Instance(), "hier_code");
118 ACL::Prototype ACLHTTPRepHeader::RegistryProtoype(&ACLHTTPRepHeader::RegistryEntry_, "rep_header");
119 ACLStrategised<HttpHeader*> ACLHTTPRepHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPRepHeaderStrategy::Instance(), "rep_header");
120 ACL::Prototype ACLHTTPReqHeader::RegistryProtoype(&ACLHTTPReqHeader::RegistryEntry_, "req_header");
121 ACLStrategised<HttpHeader*> ACLHTTPReqHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPReqHeaderStrategy::Instance(), "req_header");
122 ACL::Prototype ACLHTTPStatus::RegistryProtoype(&ACLHTTPStatus::RegistryEntry_, "http_status");
123 ACLHTTPStatus ACLHTTPStatus::RegistryEntry_("http_status");
124 ACL::Prototype ACLMaxConnection::RegistryProtoype(&ACLMaxConnection::RegistryEntry_, "maxconn");
125 ACLMaxConnection ACLMaxConnection::RegistryEntry_("maxconn");
126 ACL::Prototype ACLMethod::RegistryProtoype(&ACLMethod::RegistryEntry_, "method");
127 ACLStrategised<HttpRequestMethod> ACLMethod::RegistryEntry_(new ACLMethodData, ACLMethodStrategy::Instance(), "method");
128 ACL::Prototype ACLLocalIP::RegistryProtoype(&ACLLocalIP::RegistryEntry_, "localip");
129 ACLLocalIP ACLLocalIP::RegistryEntry_;
130 ACL::Prototype ACLLocalPort::RegistryProtoype(&ACLLocalPort::RegistryEntry_, "localport");
131 ACLStrategised<int> ACLLocalPort::RegistryEntry_(new ACLIntRange, ACLLocalPortStrategy::Instance(), "localport");
132 ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname");
133 ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname");
134 ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername");
135 ACLStrategised<const char *> ACLPeerName::RegistryEntry_(new ACLStringData, ACLPeerNameStrategy::Instance(), "peername");
136 ACL::Prototype ACLPeerName::RegexRegistryProtoype(&ACLPeerName::RegexRegistryEntry_, "peername_regex");
137 ACLStrategised<char const *> ACLPeerName::RegexRegistryEntry_(new ACLRegexData, ACLPeerNameStrategy::Instance(), "peername_regex");
138 ACL::Prototype ACLProtocol::RegistryProtoype(&ACLProtocol::RegistryEntry_, "proto");
139 ACLStrategised<AnyP::ProtocolType> ACLProtocol::RegistryEntry_(new ACLProtocolData, ACLProtocolStrategy::Instance(), "proto");
140 ACL::Prototype ACLRandom::RegistryProtoype(&ACLRandom::RegistryEntry_, "random");
141 ACLRandom ACLRandom::RegistryEntry_("random");
142 ACL::Prototype ACLReferer::RegistryProtoype(&ACLReferer::RegistryEntry_, "referer_regex");
143 ACLStrategised<char const *> ACLReferer::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_REFERER>::Instance(), "referer_regex");
144 ACL::Prototype ACLReplyMIMEType::RegistryProtoype(&ACLReplyMIMEType::RegistryEntry_, "rep_mime_type");
145 ACLStrategised<char const *> ACLReplyMIMEType::RegistryEntry_(new ACLRegexData, ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "rep_mime_type");
146 ACL::Prototype ACLRequestMIMEType::RegistryProtoype(&ACLRequestMIMEType::RegistryEntry_, "req_mime_type");
147 ACLStrategised<char const *> ACLRequestMIMEType::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "req_mime_type");
148 ACL::Prototype ACLSourceDomain::LiteralRegistryProtoype(&ACLSourceDomain::LiteralRegistryEntry_, "srcdomain");
149 ACLStrategised<char const *> ACLSourceDomain::LiteralRegistryEntry_(new ACLDomainData, ACLSourceDomainStrategy::Instance(), "srcdomain");
150 ACL::Prototype ACLSourceDomain::RegexRegistryProtoype(&ACLSourceDomain::RegexRegistryEntry_, "srcdom_regex");
151 ACLStrategised<char const *> ACLSourceDomain::RegexRegistryEntry_(new ACLRegexData,ACLSourceDomainStrategy::Instance() ,"srcdom_regex");
152 ACL::Prototype ACLSourceIP::RegistryProtoype(&ACLSourceIP::RegistryEntry_, "src");
153 ACLSourceIP ACLSourceIP::RegistryEntry_;
154 ACL::Prototype ACLTime::RegistryProtoype(&ACLTime::RegistryEntry_, "time");
155 ACLStrategised<time_t> ACLTime::RegistryEntry_(new ACLTimeData, ACLTimeStrategy::Instance(), "time");
156 ACL::Prototype ACLUrl::RegistryProtoype(&ACLUrl::RegistryEntry_, "url_regex");
157 ACLStrategised<char const *> ACLUrl::RegistryEntry_(new ACLRegexData, ACLUrlStrategy::Instance(), "url_regex");
158 ACL::Prototype ACLUrlLogin::RegistryProtoype(&ACLUrlLogin::RegistryEntry_, "urllogin");
159 ACLStrategised<char const *> ACLUrlLogin::RegistryEntry_(new ACLRegexData, ACLUrlLoginStrategy::Instance(), "urllogin");
160 ACL::Prototype ACLUrlPath::LegacyRegistryProtoype(&ACLUrlPath::RegistryEntry_, "pattern");
161 ACL::Prototype ACLUrlPath::RegistryProtoype(&ACLUrlPath::RegistryEntry_, "urlpath_regex");
162 ACLStrategised<char const *> ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrlPathStrategy::Instance(), "urlpath_regex");
163 ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port");
164 ACLStrategised<int> ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port");
165
166 #if USE_OPENSSL
167 ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error");
168 ACLStrategised<const Ssl::CertErrors *> ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error");
169 ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert");
170 ACLStrategised<X509 *> ACLCertificate::UserRegistryEntry_(new ACLCertificateData (Ssl::GetX509UserAttribute, "*"), ACLCertificateStrategy::Instance(), "user_cert");
171 ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEntry_, "ca_cert");
172 ACLStrategised<X509 *> ACLCertificate::CARegistryEntry_(new ACLCertificateData (Ssl::GetX509CAAttribute, "*"), ACLCertificateStrategy::Instance(), "ca_cert");
173 ACL::Prototype ACLServerCertificate::X509FingerprintRegistryProtoype(&ACLServerCertificate::X509FingerprintRegistryEntry_, "server_cert_fingerprint");
174 ACLStrategised<X509 *> ACLServerCertificate::X509FingerprintRegistryEntry_(new ACLCertificateData(Ssl::GetX509Fingerprint, "-sha1", true), ACLServerCertificateStrategy::Instance(), "server_cert_fingerprint");
175
176 ACL::Prototype ACLAtStep::RegistryProtoype(&ACLAtStep::RegistryEntry_, "at_step");
177 ACLStrategised<Ssl::BumpStep> ACLAtStep::RegistryEntry_(new ACLAtStepData, ACLAtStepStrategy::Instance(), "at_step");
178 #endif
179
180 #if USE_SQUID_EUI
181 ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp");
182 ACLARP ACLARP::RegistryEntry_("arp");
183 ACL::Prototype ACLEui64::RegistryProtoype(&ACLEui64::RegistryEntry_, "eui64");
184 ACLEui64 ACLEui64::RegistryEntry_("eui64");
185 #endif
186
187 #if USE_IDENT
188 ACL::Prototype ACLIdent::UserRegistryProtoype(&ACLIdent::UserRegistryEntry_, "ident");
189 ACLIdent ACLIdent::UserRegistryEntry_(new ACLUserData, "ident");
190 ACL::Prototype ACLIdent::RegexRegistryProtoype(&ACLIdent::RegexRegistryEntry_, "ident_regex" );
191 ACLIdent ACLIdent::RegexRegistryEntry_(new ACLRegexData, "ident_regex");
192 #endif
193
194 #if USE_AUTH
195 ACL::Prototype ACLProxyAuth::UserRegistryProtoype(&ACLProxyAuth::UserRegistryEntry_, "proxy_auth");
196 ACLProxyAuth ACLProxyAuth::UserRegistryEntry_(new ACLUserData, "proxy_auth");
197 ACL::Prototype ACLProxyAuth::RegexRegistryProtoype(&ACLProxyAuth::RegexRegistryEntry_, "proxy_auth_regex" );
198 ACLProxyAuth ACLProxyAuth::RegexRegistryEntry_(new ACLRegexData, "proxy_auth_regex");
199
200 ACL::Prototype ACLMaxUserIP::RegistryProtoype(&ACLMaxUserIP::RegistryEntry_, "max_user_ip");
201 ACLMaxUserIP ACLMaxUserIP::RegistryEntry_("max_user_ip");
202 #endif
203
204 ACL::Prototype ACLTag::RegistryProtoype(&ACLTag::RegistryEntry_, "tag");
205 ACLStrategised<const char *> ACLTag::RegistryEntry_(new ACLStringData, ACLTagStrategy::Instance(), "tag");
206
207 ACL::Prototype Acl::AnyOf::RegistryProtoype(&Acl::AnyOf::RegistryEntry_, "any-of");
208 Acl::AnyOf Acl::AnyOf::RegistryEntry_;
209
210 ACL::Prototype Acl::AllOf::RegistryProtoype(&Acl::AllOf::RegistryEntry_, "all-of");
211 Acl::AllOf Acl::AllOf::RegistryEntry_;
212
213 ACL::Prototype ACLNote::RegistryProtoype(&ACLNote::RegistryEntry_, "note");
214 ACLStrategised<HttpRequest *> ACLNote::RegistryEntry_(new ACLNoteData, ACLNoteStrategy::Instance(), "note");
215
216 #if USE_ADAPTATION
217 ACL::Prototype ACLAdaptationService::RegistryProtoype(&ACLAdaptationService::RegistryEntry_, "adaptation_service");
218 ACLStrategised<const char *> ACLAdaptationService::RegistryEntry_(new ACLAdaptationServiceData, ACLAdaptationServiceStrategy::Instance(), "adaptation_service");
219 #endif