]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AclRegs.cc
Author: Francesco Chemolli <kinkie@squid-cache.org>
[thirdparty/squid.git] / src / AclRegs.cc
1 #include "squid.h"
2
3 /** This file exists to provide satic registration code to executables
4 that need ACLs. We cannot place this code in acl/lib*.la because it
5 does not get linked in, because nobody is using these classes by name.
6 */
7
8 #include "acl/Acl.h"
9 #ifdef USE_ARP_ACL
10 #include "acl/Arp.h"
11 #endif
12 #include "acl/Asn.h"
13 #include "acl/Browser.h"
14 #include "acl/Checklist.h"
15 #include "acl/Data.h"
16 #include "acl/DestinationAsn.h"
17 #include "acl/DestinationDomain.h"
18 #include "acl/DestinationIp.h"
19 #include "acl/DomainData.h"
20 #include "acl/ExtUser.h"
21 #include "acl/FilledChecklist.h"
22 #include "acl/Gadgets.h"
23 #include "acl/HttpHeaderData.h"
24 #include "acl/HttpRepHeader.h"
25 #include "acl/HttpReqHeader.h"
26 #include "acl/HttpStatus.h"
27 #include "acl/IntRange.h"
28 #include "acl/Ip.h"
29 #include "acl/MaxConnection.h"
30 #include "acl/MethodData.h"
31 #include "acl/Method.h"
32 #include "acl/MyIp.h"
33 #include "acl/MyPort.h"
34 #include "acl/MyPortName.h"
35 #include "acl/PeerName.h"
36 #include "acl/ProtocolData.h"
37 #include "acl/Protocol.h"
38 #include "acl/Referer.h"
39 #include "acl/RegexData.h"
40 #include "acl/ReplyHeaderStrategy.h"
41 #include "acl/ReplyMimeType.h"
42 #include "acl/RequestHeaderStrategy.h"
43 #include "acl/RequestMimeType.h"
44 #include "acl/SourceAsn.h"
45 #include "acl/SourceDomain.h"
46 #include "acl/SourceIp.h"
47 #ifdef USE_SSL
48 #include "acl/SslErrorData.h"
49 #include "acl/SslError.h"
50 #include "acl/CertificateData.h"
51 #include "acl/Certificate.h"
52 #endif
53 #include "acl/Strategised.h"
54 #include "acl/Strategy.h"
55 #include "acl/StringData.h"
56 #include "acl/Tag.h"
57 #include "acl/TimeData.h"
58 #include "acl/Time.h"
59 #include "acl/Url.h"
60 #include "acl/UrlPath.h"
61 #include "acl/UrlPort.h"
62 #include "acl/UserData.h"
63 #include "auth/AclProxyAuth.h"
64 #include "auth/AclMaxUserIp.h"
65 #if USE_IDENT
66 #include "ident/AclIdent.h"
67 #endif
68
69
70 ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser");
71 ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_USER_AGENT>::Instance(), "browser");
72 ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain");
73 ACLStrategised<char const *> ACLDestinationDomain::LiteralRegistryEntry_(new ACLDomainData, ACLDestinationDomainStrategy::Instance(), "dstdomain");
74 ACL::Prototype ACLDestinationDomain::RegexRegistryProtoype(&ACLDestinationDomain::RegexRegistryEntry_, "dstdom_regex");
75 ACLStrategised<char const *> ACLDestinationDomain::RegexRegistryEntry_(new ACLRegexData,ACLDestinationDomainStrategy::Instance() ,"dstdom_regex");
76 ACL::Prototype ACLDestinationIP::RegistryProtoype(&ACLDestinationIP::RegistryEntry_, "dst");
77 ACLDestinationIP ACLDestinationIP::RegistryEntry_;
78 ACL::Prototype ACLExtUser::UserRegistryProtoype(&ACLExtUser::UserRegistryEntry_, "ext_user");
79 ACLExtUser ACLExtUser::UserRegistryEntry_(new ACLUserData, "ext_user");
80 ACL::Prototype ACLExtUser::RegexRegistryProtoype(&ACLExtUser::RegexRegistryEntry_, "ext_user_regex" );
81 ACLExtUser ACLExtUser::RegexRegistryEntry_(new ACLRegexData, "ext_user_regex");
82 ACL::Prototype ACLHTTPRepHeader::RegistryProtoype(&ACLHTTPRepHeader::RegistryEntry_, "rep_header");
83 ACLStrategised<HttpHeader*> ACLHTTPRepHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPRepHeaderStrategy::Instance(), "rep_header");
84 ACL::Prototype ACLHTTPReqHeader::RegistryProtoype(&ACLHTTPReqHeader::RegistryEntry_, "req_header");
85 ACLStrategised<HttpHeader*> ACLHTTPReqHeader::RegistryEntry_(new ACLHTTPHeaderData, ACLHTTPReqHeaderStrategy::Instance(), "req_header");
86 ACL::Prototype ACLHTTPStatus::RegistryProtoype(&ACLHTTPStatus::RegistryEntry_, "http_status");
87 ACLHTTPStatus ACLHTTPStatus::RegistryEntry_("http_status");
88 ACL::Prototype ACLMaxConnection::RegistryProtoype(&ACLMaxConnection::RegistryEntry_, "maxconn");
89 ACLMaxConnection ACLMaxConnection::RegistryEntry_("maxconn");
90 ACL::Prototype ACLMethod::RegistryProtoype(&ACLMethod::RegistryEntry_, "method");
91 ACLStrategised<HttpRequestMethod> ACLMethod::RegistryEntry_(new ACLMethodData, ACLMethodStrategy::Instance(), "method");
92 ACLMyIP ACLMyIP::RegistryEntry_;
93 ACLMyIP const &ACLMyIP::RegistryEntry() {return RegistryEntry_;}
94 ACL::Prototype ACLMyPort::RegistryProtoype(&ACLMyPort::RegistryEntry_, "myport");
95 ACLStrategised<int> ACLMyPort::RegistryEntry_(new ACLIntRange, ACLMyPortStrategy::Instance(), "myport");
96 ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname");
97 ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname");
98 ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername");
99 ACLStrategised<const char *> ACLPeerName::RegistryEntry_(new ACLStringData, ACLPeerNameStrategy::Instance(), "peername");
100 ACL::Prototype ACLProtocol::RegistryProtoype(&ACLProtocol::RegistryEntry_, "proto");
101 ACLStrategised<protocol_t> ACLProtocol::RegistryEntry_(new ACLProtocolData, ACLProtocolStrategy::Instance(), "proto");
102 ACL::Prototype ACLReferer::RegistryProtoype(&ACLReferer::RegistryEntry_, "referer_regex");
103 ACLStrategised<char const *> ACLReferer::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_REFERER>::Instance(), "referer_regex");
104 ACL::Prototype ACLReplyMIMEType::RegistryProtoype(&ACLReplyMIMEType::RegistryEntry_, "rep_mime_type");
105 ACLStrategised<char const *> ACLReplyMIMEType::RegistryEntry_(new ACLRegexData, ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "rep_mime_type");
106 ACL::Prototype ACLRequestMIMEType::RegistryProtoype(&ACLRequestMIMEType::RegistryEntry_, "req_mime_type");
107 ACLStrategised<char const *> ACLRequestMIMEType::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>::Instance(), "req_mime_type");
108 ACL::Prototype ACLSourceDomain::LiteralRegistryProtoype(&ACLSourceDomain::LiteralRegistryEntry_, "srcdomain");
109 ACLStrategised<char const *> ACLSourceDomain::LiteralRegistryEntry_(new ACLDomainData, ACLSourceDomainStrategy::Instance(), "srcdomain");
110 ACL::Prototype ACLSourceDomain::RegexRegistryProtoype(&ACLSourceDomain::RegexRegistryEntry_, "srcdom_regex");
111 ACLStrategised<char const *> ACLSourceDomain::RegexRegistryEntry_(new ACLRegexData,ACLSourceDomainStrategy::Instance() ,"srcdom_regex");
112 ACL::Prototype ACLSourceIP::RegistryProtoype(&ACLSourceIP::RegistryEntry_, "src");
113 ACLSourceIP ACLSourceIP::RegistryEntry_;
114 ACL::Prototype ACLTime::RegistryProtoype(&ACLTime::RegistryEntry_, "time");
115 ACLStrategised<time_t> ACLTime::RegistryEntry_(new ACLTimeData, ACLTimeStrategy::Instance(), "time");
116 ACL::Prototype ACLUrl::RegistryProtoype(&ACLUrl::RegistryEntry_, "url_regex");
117 ACLStrategised<char const *> ACLUrl::RegistryEntry_(new ACLRegexData, ACLUrlStrategy::Instance(), "url_regex");
118 ACL::Prototype ACLUrlPath::LegacyRegistryProtoype(&ACLUrlPath::RegistryEntry_, "pattern");
119 ACL::Prototype ACLUrlPath::RegistryProtoype(&ACLUrlPath::RegistryEntry_, "urlpath_regex");
120 ACLStrategised<char const *> ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrlPathStrategy::Instance(), "urlpath_regex");
121 ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port");
122 ACLStrategised<int> ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port");
123
124 #ifdef USE_SSL
125 ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error");
126 ACLStrategised<int> ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error");
127 ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert");
128 ACLStrategised<SSL *> ACLCertificate::UserRegistryEntry_(new ACLCertificateData (sslGetUserAttribute), ACLCertificateStrategy::Instance(), "user_cert");
129 ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEntry_, "ca_cert");
130 ACLStrategised<SSL *> ACLCertificate::CARegistryEntry_(new ACLCertificateData (sslGetCAAttribute), ACLCertificateStrategy::Instance(), "ca_cert");
131 #endif
132
133 #ifdef USE_ARP_ACL
134 ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp");
135 ACLARP ACLARP::RegistryEntry_("arp");
136 #endif
137
138 #if USE_IDENT
139 ACL::Prototype ACLIdent::UserRegistryProtoype(&ACLIdent::UserRegistryEntry_, "ident");
140 ACLIdent ACLIdent::UserRegistryEntry_(new ACLUserData, "ident");
141 ACL::Prototype ACLIdent::RegexRegistryProtoype(&ACLIdent::RegexRegistryEntry_, "ident_regex" );
142 ACLIdent ACLIdent::RegexRegistryEntry_(new ACLRegexData, "ident_regex");
143 #endif
144
145
146 ACL::Prototype ACLProxyAuth::UserRegistryProtoype(&ACLProxyAuth::UserRegistryEntry_, "proxy_auth");
147 ACLProxyAuth ACLProxyAuth::UserRegistryEntry_(new ACLUserData, "proxy_auth");
148 ACL::Prototype ACLProxyAuth::RegexRegistryProtoype(&ACLProxyAuth::RegexRegistryEntry_, "proxy_auth_regex" );
149 ACLProxyAuth ACLProxyAuth::RegexRegistryEntry_(new ACLRegexData, "proxy_auth_regex");
150
151 ACL::Prototype ACLMaxUserIP::RegistryProtoype(&ACLMaxUserIP::RegistryEntry_, "max_user_ip");
152 ACLMaxUserIP ACLMaxUserIP::RegistryEntry_("max_user_ip");
153
154 ACL::Prototype ACLTag::RegistryProtoype(&ACLTag::RegistryEntry_, "tag");
155 ACLStrategised<const char *> ACLTag::RegistryEntry_(new ACLStringData, ACLTagStrategy::Instance(), "tag");