AmigaOS bugfix: PCRS needs a lot of stack, stacksize for child threads
[privoxy.git] / filters.h
1 #ifndef _FILTERS_H
2 #define _FILTERS_H
3 #define FILTERS_H_VERSION "$Id: filters.h,v 1.5 2001/05/27 22:17:04 oes Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/filters.h,v $
7  *
8  * Purpose     :  Declares functions to parse/crunch headers and pages.
9  *                Functions declared include:
10  *                   `acl_addr', `add_stats', `block_acl', `block_imageurl',
11  *                   `block_url', `url_permissions', `domaincmp', `dsplit',
12  *                   `filter_popups', `forward_url'
13  *                   `ij_untrusted_url', `intercept_url', `re_process_buffer',
14  *                   `show_proxy_args', and `trust_url'
15  *
16  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
17  *                IJBSWA team.  http://ijbswa.sourceforge.net
18  *
19  *                Based on the Internet Junkbuster originally written
20  *                by and Copyright (C) 1997 Anonymous Coders and 
21  *                Junkbusters Corporation.  http://www.junkbusters.com
22  *
23  *                This program is free software; you can redistribute it 
24  *                and/or modify it under the terms of the GNU General
25  *                Public License as published by the Free Software
26  *                Foundation; either version 2 of the License, or (at
27  *                your option) any later version.
28  *
29  *                This program is distributed in the hope that it will
30  *                be useful, but WITHOUT ANY WARRANTY; without even the
31  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
32  *                PARTICULAR PURPOSE.  See the GNU General Public
33  *                License for more details.
34  *
35  *                The GNU General Public License should be included with
36  *                this file.  If not, you can view it at
37  *                http://www.gnu.org/copyleft/gpl.html
38  *                or write to the Free Software Foundation, Inc., 59
39  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
40  *
41  * Revisions   :
42  *    $Log: filters.h,v $
43  *    Revision 1.5  2001/05/27 22:17:04  oes
44  *
45  *    - re_process_buffer no longer writes the modified buffer
46  *      to the client, which was very ugly. It now returns the
47  *      buffer, which it is then written by chat.
48  *
49  *    - content_length now adjusts the Content-Length: header
50  *      for modified documents rather than crunch()ing it.
51  *      (Length info in csp->content_length, which is 0 for
52  *      unmodified documents)
53  *
54  *    - For this to work, sed() is called twice when filtering.
55  *
56  *    Revision 1.4  2001/05/26 15:26:15  jongfoster
57  *    ACL feature now provides more security by immediately dropping
58  *    connections from untrusted hosts.
59  *
60  *    Revision 1.3  2001/05/22 18:46:04  oes
61  *
62  *    - Enabled filtering banners by size rather than URL
63  *      by adding patterns that replace all standard banner
64  *      sizes with the "Junkbuster" gif to the re_filterfile
65  *
66  *    - Enabled filtering WebBugs by providing a pattern
67  *      which kills all 1x1 images
68  *
69  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
70  *      which is selected by the (nonstandard and therefore
71  *      capital) letter 'U' in the option string.
72  *      It causes the quantifiers to be ungreedy by default.
73  *      Appending a ? turns back to greedy (!).
74  *
75  *    - Added a new interceptor ijb-send-banner, which
76  *      sends back the "Junkbuster" gif. Without imagelist or
77  *      MSIE detection support, or if tinygif = 1, or the
78  *      URL isn't recognized as an imageurl, a lame HTML
79  *      explanation is sent instead.
80  *
81  *    - Added new feature, which permits blocking remote
82  *      script redirects and firing back a local redirect
83  *      to the browser.
84  *      The feature is conditionally compiled, i.e. it
85  *      can be disabled with --disable-fast-redirects,
86  *      plus it must be activated by a "fast-redirects"
87  *      line in the config file, has its own log level
88  *      and of course wants to be displayed by show-proxy-args
89  *      Note: Boy, all the #ifdefs in 1001 locations and
90  *      all the fumbling with configure.in and acconfig.h
91  *      were *way* more work than the feature itself :-(
92  *
93  *    - Because a generic redirect template was needed for
94  *      this, tinygif = 3 now uses the same.
95  *
96  *    - Moved GIFs, and other static HTTP response templates
97  *      to project.h
98  *
99  *    - Some minor fixes
100  *
101  *    - Removed some >400 CRs again (Jon, you really worked
102  *      a lot! ;-)
103  *
104  *    Revision 1.2  2001/05/20 01:21:20  jongfoster
105  *    Version 2.9.4 checkin.
106  *    - Merged popupfile and cookiefile, and added control over PCRS
107  *      filtering, in new "permissionsfile".
108  *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
109  *      file error you now get a message box (in the Win32 GUI) rather
110  *      than the program exiting with no explanation.
111  *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
112  *      skipping.
113  *    - Removed tabs from "config"
114  *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
115  *    - Bumped up version number.
116  *
117  *    Revision 1.1.1.1  2001/05/15 13:58:52  oes
118  *    Initial import of version 2.9.3 source tree
119  *
120  *
121  *********************************************************************/
122 \f
123
124 #include "project.h"
125
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129
130 #ifdef ACL_FILES
131 extern int block_acl(struct access_control_addr *dst, struct client_state *csp);
132 extern int acl_addr(char *aspec, struct access_control_addr *aca);
133 #endif /* def ACL_FILES */
134
135 extern char *block_url(struct http_request *http, struct client_state *csp);
136 #ifdef TRUST_FILES
137 extern char *trust_url(struct http_request *http, struct client_state *csp);
138 #endif /* def TRUST_FILES */
139 extern int intercept_url(struct http_request *http, struct client_state *csp);
140 extern char *redirect_url(struct http_request *http, struct client_state *csp);
141
142 #ifdef IMAGE_BLOCKING
143 extern int block_imageurl(struct http_request *http, struct client_state *csp);
144 #endif /* def IMAGE_BLOCKING */
145
146 extern int url_permissions(struct http_request *http, struct client_state *csp);
147 extern const struct gateway *forward_url(struct http_request *http, struct client_state *csp);
148
149 extern struct url_spec dsplit(char *domain);
150 extern int domaincmp(struct url_spec *pattern, struct url_spec *fqdn);
151
152 extern char *show_proxy_args(struct http_request *http, struct client_state *csp);
153 extern char *ijb_send_banner(struct http_request *http, struct client_state *csp);
154
155 #ifdef TRUST_FILES
156 extern char *ij_untrusted_url(struct http_request *http, struct client_state *csp);
157 #endif /* def TRUST_FILES */
158
159 char *ijb_show_url_info(struct http_request *http, struct client_state *csp);
160
161 #ifdef STATISTICS
162 extern char *add_stats(char *s);
163 #endif /* def STATISTICS */
164
165 #ifdef PCRS
166 extern char *re_process_buffer(struct client_state *csp);
167 #endif /* def PCRS */
168
169 /* Revision control strings from this header and associated .c file */
170 extern const char filters_rcs[];
171 extern const char filters_h_rcs[];
172
173 #ifdef __cplusplus
174 } /* extern "C" */
175 #endif
176
177 #endif /* ndef _FILTERS_H */
178
179 /*
180   Local Variables:
181   tab-width: 3
182   end:
183 */